Quellcode durchsuchen

api: swagger: move VolumeListResponse to definitions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn vor 3 Jahren
Ursprung
Commit
cd635e465d

+ 20 - 18
api/swagger.yaml

@@ -2069,6 +2069,25 @@ definitions:
           com.example.some-label: "some-value"
           com.example.some-other-label: "some-other-value"
 
+  VolumeListResponse:
+    type: "object"
+    title: "VolumeListResponse"
+    x-go-name: "VolumeListOKBody"
+    description: "Volume list response"
+    properties:
+      Volumes:
+        type: "array"
+        description: "List of volumes"
+        items:
+          $ref: "#/definitions/Volume"
+      Warnings:
+        type: "array"
+        description: |
+          Warnings that occurred when fetching the list of volumes.
+        items:
+          type: "string"
+        example: []
+
   Network:
     type: "object"
     properties:
@@ -9145,24 +9164,7 @@ paths:
         200:
           description: "Summary volume data that matches the query"
           schema:
-            type: "object"
-            title: "VolumeListResponse"
-            description: "Volume list response"
-            required: [Volumes, Warnings]
-            properties:
-              Volumes:
-                type: "array"
-                x-nullable: false
-                description: "List of volumes"
-                items:
-                  $ref: "#/definitions/Volume"
-              Warnings:
-                type: "array"
-                x-nullable: false
-                description: |
-                  Warnings that occurred when fetching the list of volumes.
-                items:
-                  type: "string"
+            $ref: "#/definitions/VolumeListResponse"
         500:
           description: "Server error"
           schema:

+ 0 - 23
api/types/volume/volume_list.go

@@ -1,23 +0,0 @@
-package volume // import "github.com/docker/docker/api/types/volume"
-
-// ----------------------------------------------------------------------------
-// Code generated by `swagger generate operation`. DO NOT EDIT.
-//
-// See hack/generate-swagger-api.sh
-// ----------------------------------------------------------------------------
-
-import "github.com/docker/docker/api/types"
-
-// VolumeListOKBody Volume list response
-// swagger:model VolumeListOKBody
-type VolumeListOKBody struct {
-
-	// List of volumes
-	// Required: true
-	Volumes []*types.Volume `json:"Volumes"`
-
-	// Warnings that occurred when fetching the list of volumes.
-	//
-	// Required: true
-	Warnings []string `json:"Warnings"`
-}

+ 18 - 0
api/types/volume/volume_list_o_k_body.go

@@ -0,0 +1,18 @@
+package volume
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+// VolumeListOKBody VolumeListResponse
+//
+// Volume list response
+// swagger:model VolumeListOKBody
+type VolumeListOKBody struct {
+
+	// List of volumes
+	Volumes []*Volume `json:"Volumes"`
+
+	// Warnings that occurred when fetching the list of volumes.
+	//
+	Warnings []string `json:"Warnings"`
+}

+ 3 - 3
hack/generate-swagger-api.sh

@@ -24,7 +24,8 @@ swagger generate model -f api/swagger.yaml \
 swagger generate model -f api/swagger.yaml \
 	-t api -m types/volume --skip-validator -C api/swagger-gen.yaml \
 	-n Volume \
-	-n VolumeCreateOptions
+	-n VolumeCreateOptions \
+	-n VolumeListResponse
 
 swagger generate operation -f api/swagger.yaml \
 	-t api -a types -m types -C api/swagger-gen.yaml \
@@ -34,5 +35,4 @@ swagger generate operation -f api/swagger.yaml \
 	-n ContainerCreate \
 	-n ContainerTop \
 	-n ContainerUpdate \
-	-n ImageHistory \
-	-n VolumeList
+	-n ImageHistory