Ver código fonte

Merge pull request #43344 from ndeloof/issue_43341

cleanup swagger multi-examples
Sebastiaan van Stijn 3 anos atrás
pai
commit
5e330ad4da
1 arquivos alterados com 11 adições e 23 exclusões
  1. 11 23
      api/swagger.yaml

+ 11 - 23
api/swagger.yaml

@@ -3827,6 +3827,7 @@ definitions:
 
 
   ServiceSpec:
   ServiceSpec:
     description: "User modifiable configuration for a service."
     description: "User modifiable configuration for a service."
+    type: object
     properties:
     properties:
       Name:
       Name:
         description: "Name of the service."
         description: "Name of the service."
@@ -5369,6 +5370,7 @@ definitions:
 
 
   PeerNode:
   PeerNode:
     description: "Represents a peer-node in the swarm"
     description: "Represents a peer-node in the swarm"
+    type: "object"
     properties:
     properties:
       NodeID:
       NodeID:
         description: "Unique identifier of for this node in the swarm."
         description: "Unique identifier of for this node in the swarm."
@@ -7319,17 +7321,7 @@ paths:
         400:
         400:
           description: "Bad parameter"
           description: "Bad parameter"
           schema:
           schema:
-            allOf:
-              - $ref: "#/definitions/ErrorResponse"
-              - type: "object"
-                properties:
-                  message:
-                    description: |
-                      The error message. Either "must specify path parameter"
-                      (path cannot be empty) or "not a directory" (path was
-                      asserted to be a directory but exists as a file).
-                    type: "string"
-                    x-nullable: false
+            $ref: "#/definitions/ErrorResponse"
         404:
         404:
           description: "Container or path does not exist"
           description: "Container or path does not exist"
           schema:
           schema:
@@ -7364,17 +7356,7 @@ paths:
         400:
         400:
           description: "Bad parameter"
           description: "Bad parameter"
           schema:
           schema:
-            allOf:
-              - $ref: "#/definitions/ErrorResponse"
-              - type: "object"
-                properties:
-                  message:
-                    description: |
-                      The error message. Either "must specify path parameter"
-                      (path cannot be empty) or "not a directory" (path was
-                      asserted to be a directory but exists as a file).
-                    type: "string"
-                    x-nullable: false
+            $ref: "#/definitions/ErrorResponse"
         404:
         404:
           description: "Container or path does not exist"
           description: "Container or path does not exist"
           schema:
           schema:
@@ -7400,7 +7382,10 @@ paths:
       tags: ["Container"]
       tags: ["Container"]
     put:
     put:
       summary: "Extract an archive of files or folders to a directory in a container"
       summary: "Extract an archive of files or folders to a directory in a container"
-      description: "Upload a tar archive to be extracted to a path in the filesystem of container id."
+      description: |
+        Upload a tar archive to be extracted to a path in the filesystem of container id.
+        `path` parameter is asserted to be a directory. If it exists as a file, 400 error
+        will be returned with message "not a directory".
       operationId: "PutContainerArchive"
       operationId: "PutContainerArchive"
       consumes: ["application/x-tar", "application/octet-stream"]
       consumes: ["application/x-tar", "application/octet-stream"]
       responses:
       responses:
@@ -7410,6 +7395,9 @@ paths:
           description: "Bad parameter"
           description: "Bad parameter"
           schema:
           schema:
             $ref: "#/definitions/ErrorResponse"
             $ref: "#/definitions/ErrorResponse"
+          examples:
+            application/json:
+              message: "not a directory"
         403:
         403:
           description: "Permission denied, the volume or container rootfs is marked as read-only."
           description: "Permission denied, the volume or container rootfs is marked as read-only."
           schema:
           schema: