Browse code

Merge pull request #35593 from ndeloof/master

Improve swagger schema for code generation

Sebastiaan van Stijn authored on 2018/01/08 20:17:56
Showing 8 changed files
... ...
@@ -4502,6 +4502,8 @@ paths:
4502 4502
           description: "Container created successfully"
4503 4503
           schema:
4504 4504
             type: "object"
4505
+            title: "ContainerCreateResponse"
4506
+            description: "OK response to ContainerCreate operation"
4505 4507
             required: [Id, Warnings]
4506 4508
             properties:
4507 4509
               Id:
... ...
@@ -4550,6 +4552,7 @@ paths:
4550 4550
           description: "no error"
4551 4551
           schema:
4552 4552
             type: "object"
4553
+            title: "ContainerInspectResponse"
4553 4554
             properties:
4554 4555
               Id:
4555 4556
                 description: "The ID of the container"
... ...
@@ -4834,6 +4837,8 @@ paths:
4834 4834
           description: "no error"
4835 4835
           schema:
4836 4836
             type: "object"
4837
+            title: "ContainerTopResponse"
4838
+            description: "OK response to ContainerTop operation"
4837 4839
             properties:
4838 4840
               Titles:
4839 4841
                 description: "The ps column titles"
... ...
@@ -4994,6 +4999,8 @@ paths:
4994 4994
             items:
4995 4995
               type: "object"
4996 4996
               x-go-name: "ContainerChangeResponseItem"
4997
+              title: "ContainerChangeResponseItem"
4998
+              description: "change item in response to ContainerChanges operation"
4997 4999
               required: [Path, Kind]
4998 5000
               properties:
4999 5001
                 Path:
... ...
@@ -5372,6 +5379,8 @@ paths:
5372 5372
           description: "The container has been updated."
5373 5373
           schema:
5374 5374
             type: "object"
5375
+            title: "ContainerUpdateResponse"
5376
+            description: "OK response to ContainerUpdate operation"
5375 5377
             properties:
5376 5378
               Warnings:
5377 5379
                 type: "array"
... ...
@@ -5725,6 +5734,8 @@ paths:
5725 5725
           description: "The container has exit."
5726 5726
           schema:
5727 5727
             type: "object"
5728
+            title: "ContainerWaitResponse"
5729
+            description: "OK response to ContainerWait operation"
5728 5730
             required: [StatusCode]
5729 5731
             properties:
5730 5732
               StatusCode:
... ...
@@ -5970,6 +5981,7 @@ paths:
5970 5970
           description: "No error"
5971 5971
           schema:
5972 5972
             type: "object"
5973
+            title: "ContainerPruneResponse"
5973 5974
             properties:
5974 5975
               ContainersDeleted:
5975 5976
                 description: "Container IDs that were deleted"
... ...
@@ -6226,6 +6238,7 @@ paths:
6226 6226
           description: "No error"
6227 6227
           schema:
6228 6228
             type: "object"
6229
+            title: "BuildPruneResponse"
6229 6230
             properties:
6230 6231
               SpaceReclaimed:
6231 6232
                 description: "Disk space reclaimed in bytes"
... ...
@@ -6411,6 +6424,8 @@ paths:
6411 6411
             items:
6412 6412
               type: "object"
6413 6413
               x-go-name: HistoryResponseItem
6414
+              title: "HistoryResponseItem"
6415
+              description: "individual image layer information in response to ImageHistory operation"
6414 6416
               required: [Id, Created, CreatedBy, Tags, Size, Comment]
6415 6417
               properties:
6416 6418
                 Id:
... ...
@@ -6617,6 +6632,7 @@ paths:
6617 6617
             type: "array"
6618 6618
             items:
6619 6619
               type: "object"
6620
+              title: "ImageSearchResponseItem"
6620 6621
               properties:
6621 6622
                 description:
6622 6623
                   type: "string"
... ...
@@ -6692,6 +6708,7 @@ paths:
6692 6692
           description: "No error"
6693 6693
           schema:
6694 6694
             type: "object"
6695
+            title: "ImagePruneResponse"
6695 6696
             properties:
6696 6697
               ImagesDeleted:
6697 6698
                 description: "Images that were deleted"
... ...
@@ -6719,6 +6736,7 @@ paths:
6719 6719
           description: "An identity token was generated successfully."
6720 6720
           schema:
6721 6721
             type: "object"
6722
+            title: "SystemAuthResponse"
6722 6723
             required: [Status]
6723 6724
             properties:
6724 6725
               Status:
... ...
@@ -6773,6 +6791,7 @@ paths:
6773 6773
           description: "no error"
6774 6774
           schema:
6775 6775
             type: "object"
6776
+            title: "SystemVersionResponse"
6776 6777
             properties:
6777 6778
               Platform:
6778 6779
                 type: "object"
... ...
@@ -6951,6 +6970,7 @@ paths:
6951 6951
           description: "no error"
6952 6952
           schema:
6953 6953
             type: "object"
6954
+            title: "SystemEventsResponse"
6954 6955
             properties:
6955 6956
               Type:
6956 6957
                 description: "The type of object emitting the event"
... ...
@@ -7034,6 +7054,7 @@ paths:
7034 7034
           description: "no error"
7035 7035
           schema:
7036 7036
             type: "object"
7037
+            title: "SystemDataUsageResponse"
7037 7038
             properties:
7038 7039
               LayersSize:
7039 7040
                 type: "integer"
... ...
@@ -7392,7 +7413,12 @@ paths:
7392 7392
           description: "No error"
7393 7393
           schema:
7394 7394
             type: "object"
7395
+            title: "ExecInspectResponse"
7395 7396
             properties:
7397
+              CanRemove:
7398
+                type: "boolean"
7399
+              DetachKeys:
7400
+                type: "string"
7396 7401
               ID:
7397 7402
                 type: "string"
7398 7403
               Running:
... ...
@@ -7458,6 +7484,7 @@ paths:
7458 7458
           description: "Summary volume data that matches the query"
7459 7459
           schema:
7460 7460
             type: "object"
7461
+            title: "VolumeListResponse"
7461 7462
             required: [Volumes, Warnings]
7462 7463
             properties:
7463 7464
               Volumes:
... ...
@@ -7639,6 +7666,7 @@ paths:
7639 7639
           description: "No error"
7640 7640
           schema:
7641 7641
             type: "object"
7642
+            title: "VolumePruneResponse"
7642 7643
             properties:
7643 7644
               VolumesDeleted:
7644 7645
                 description: "Volumes that were deleted"
... ...
@@ -7817,6 +7845,7 @@ paths:
7817 7817
           description: "No error"
7818 7818
           schema:
7819 7819
             type: "object"
7820
+            title: "NetworkCreateResponse"
7820 7821
             properties:
7821 7822
               Id:
7822 7823
                 description: "The ID of the created network."
... ...
@@ -8019,6 +8048,7 @@ paths:
8019 8019
           description: "No error"
8020 8020
           schema:
8021 8021
             type: "object"
8022
+            title: "NetworkPruneResponse"
8022 8023
             properties:
8023 8024
               NetworksDeleted:
8024 8025
                 description: "Networks that were deleted"
... ...
@@ -8070,6 +8100,7 @@ paths:
8070 8070
             items:
8071 8071
               description: "Describes a permission the user has to accept upon installing the plugin."
8072 8072
               type: "object"
8073
+              title: "PluginPrivilegeItem"
8073 8074
               properties:
8074 8075
                 Name:
8075 8076
                   type: "string"
... ...
@@ -8772,6 +8803,7 @@ paths:
8772 8772
           description: "no error"
8773 8773
           schema:
8774 8774
             type: "object"
8775
+            title: "UnlockKeyResponse"
8775 8776
             properties:
8776 8777
               UnlockKey:
8777 8778
                 description: "The swarm's unlock key."
... ...
@@ -8863,6 +8895,7 @@ paths:
8863 8863
           description: "no error"
8864 8864
           schema:
8865 8865
             type: "object"
8866
+            title: "ServiceCreateResponse"
8866 8867
             properties:
8867 8868
               ID:
8868 8869
                 description: "The ID of the created service."
... ...
@@ -9534,13 +9567,7 @@ paths:
9534 9534
         201:
9535 9535
           description: "no error"
9536 9536
           schema:
9537
-            type: "object"
9538
-            properties:
9539
-              ID:
9540
-                description: "The ID of the created secret."
9541
-                type: "string"
9542
-            example:
9543
-              ID: "ktnbjxoalbkvbvedmg1urrz8h"
9537
+            $ref: "#/definitions/IdResponse"
9544 9538
         409:
9545 9539
           description: "name conflicts with an existing object"
9546 9540
           schema:
... ...
@@ -9739,13 +9766,7 @@ paths:
9739 9739
         201:
9740 9740
           description: "no error"
9741 9741
           schema:
9742
-            type: "object"
9743
-            properties:
9744
-              ID:
9745
-                description: "The ID of the created config."
9746
-                type: "string"
9747
-            example:
9748
-              ID: "ktnbjxoalbkvbvedmg1urrz8h"
9742
+            $ref: "#/definitions/IdResponse"
9749 9743
         409:
9750 9744
           description: "name conflicts with an existing object"
9751 9745
           schema:
... ...
@@ -9891,6 +9912,7 @@ paths:
9891 9891
           schema:
9892 9892
             type: "object"
9893 9893
             x-go-name: DistributionInspect
9894
+            title: "DistributionInspectResponse"
9894 9895
             required: [Descriptor, Platforms]
9895 9896
             properties:
9896 9897
               Descriptor:
... ...
@@ -20,7 +20,7 @@ import (
20 20
 
21 21
 
22 22
 {{ range .ExtraSchemas }}
23
-// {{ .Name }} {{ template "docstring" . }}
23
+// {{ .Name }} {{ comment .Description }}
24 24
 // swagger:model {{ .Name }}
25 25
 {{ template "schema" . }}
26 26
 {{ end }}
... ...
@@ -7,7 +7,7 @@ package container
7 7
 // See hack/generate-swagger-api.sh
8 8
 // ----------------------------------------------------------------------------
9 9
 
10
-// ContainerChangeResponseItem container change response item
10
+// ContainerChangeResponseItem change item in response to ContainerChanges operation
11 11
 // swagger:model ContainerChangeResponseItem
12 12
 type ContainerChangeResponseItem struct {
13 13
 
... ...
@@ -7,7 +7,7 @@ package container
7 7
 // See hack/generate-swagger-api.sh
8 8
 // ----------------------------------------------------------------------------
9 9
 
10
-// ContainerCreateCreatedBody container create created body
10
+// ContainerCreateCreatedBody OK response to ContainerCreate operation
11 11
 // swagger:model ContainerCreateCreatedBody
12 12
 type ContainerCreateCreatedBody struct {
13 13
 
... ...
@@ -7,7 +7,7 @@ package container
7 7
 // See hack/generate-swagger-api.sh
8 8
 // ----------------------------------------------------------------------------
9 9
 
10
-// ContainerTopOKBody container top o k body
10
+// ContainerTopOKBody OK response to ContainerTop operation
11 11
 // swagger:model ContainerTopOKBody
12 12
 type ContainerTopOKBody struct {
13 13
 
... ...
@@ -7,7 +7,7 @@ package container
7 7
 // See hack/generate-swagger-api.sh
8 8
 // ----------------------------------------------------------------------------
9 9
 
10
-// ContainerUpdateOKBody container update o k body
10
+// ContainerUpdateOKBody OK response to ContainerUpdate operation
11 11
 // swagger:model ContainerUpdateOKBody
12 12
 type ContainerUpdateOKBody struct {
13 13
 
... ...
@@ -15,7 +15,7 @@ type ContainerWaitOKBodyError struct {
15 15
 	Message string `json:"Message,omitempty"`
16 16
 }
17 17
 
18
-// ContainerWaitOKBody container wait o k body
18
+// ContainerWaitOKBody OK response to ContainerWait operation
19 19
 // swagger:model ContainerWaitOKBody
20 20
 type ContainerWaitOKBody struct {
21 21
 
... ...
@@ -7,7 +7,7 @@ package image
7 7
 // See hack/generate-swagger-api.sh
8 8
 // ----------------------------------------------------------------------------
9 9
 
10
-// HistoryResponseItem history response item
10
+// HistoryResponseItem individual image layer information in response to ImageHistory operation
11 11
 // swagger:model HistoryResponseItem
12 12
 type HistoryResponseItem struct {
13 13