Browse Source

Extract PluginPrivilegeItem as explicit type definition

Signed-off-by: Tobias Gesellchen <tobias@gesellix.de>
Tobias Gesellchen 4 years ago
parent
commit
ef44b22085
1 changed files with 22 additions and 53 deletions
  1. 22 53
      api/swagger.yaml

+ 22 - 53
api/swagger.yaml

@@ -2190,6 +2190,24 @@ definitions:
         type: "string"
         type: "string"
         x-nullable: false
         x-nullable: false
 
 
+  PluginPrivilegeItem:
+    description: |
+      Describes a permission the user has to accept upon installing
+      the plugin.
+    type: "object"
+    properties:
+      Name:
+        type: "string"
+        example: "network"
+      Description:
+        type: "string"
+      Value:
+        type: "array"
+        items:
+          type: "string"
+        example:
+          - "host"
+
   Plugin:
   Plugin:
     description: "A plugin for the Engine API"
     description: "A plugin for the Engine API"
     type: "object"
     type: "object"
@@ -2972,19 +2990,7 @@ definitions:
           PluginPrivilege:
           PluginPrivilege:
             type: "array"
             type: "array"
             items:
             items:
-              description: |
-                Describes a permission accepted by the user upon installing the
-                plugin.
-              type: "object"
-              properties:
-                Name:
-                  type: "string"
-                Description:
-                  type: "string"
-                Value:
-                  type: "array"
-                  items:
-                    type: "string"
+              $ref: "#/definitions/PluginPrivilegeItem"
       ContainerSpec:
       ContainerSpec:
         type: "object"
         type: "object"
         description: |
         description: |
@@ -9413,20 +9419,7 @@ paths:
           schema:
           schema:
             type: "array"
             type: "array"
             items:
             items:
-              description: |
-                Describes a permission the user has to accept upon installing
-                the plugin.
-              type: "object"
-              title: "PluginPrivilegeItem"
-              properties:
-                Name:
-                  type: "string"
-                Description:
-                  type: "string"
-                Value:
-                  type: "array"
-                  items:
-                    type: "string"
+              $ref: "#/definitions/PluginPrivilegeItem"
             example:
             example:
               - Name: "network"
               - Name: "network"
                 Description: ""
                 Description: ""
@@ -9502,19 +9495,7 @@ paths:
           schema:
           schema:
             type: "array"
             type: "array"
             items:
             items:
-              description: |
-                Describes a permission accepted by the user upon installing the
-                plugin.
-              type: "object"
-              properties:
-                Name:
-                  type: "string"
-                Description:
-                  type: "string"
-                Value:
-                  type: "array"
-                  items:
-                    type: "string"
+              $ref: "#/definitions/PluginPrivilegeItem"
             example:
             example:
               - Name: "network"
               - Name: "network"
                 Description: ""
                 Description: ""
@@ -9686,19 +9667,7 @@ paths:
           schema:
           schema:
             type: "array"
             type: "array"
             items:
             items:
-              description: |
-                Describes a permission accepted by the user upon installing the
-                plugin.
-              type: "object"
-              properties:
-                Name:
-                  type: "string"
-                Description:
-                  type: "string"
-                Value:
-                  type: "array"
-                  items:
-                    type: "string"
+              $ref: "#/definitions/PluginPrivilegeItem"
             example:
             example:
               - Name: "network"
               - Name: "network"
                 Description: ""
                 Description: ""