From e444ac3470c67509ca19afcbac02af0c5e921d3c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 15:02:03 +0100 Subject: [PATCH 1/8] api: swagger: move Volume examples inline Signed-off-by: Sebastiaan van Stijn --- api/swagger.yaml | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/api/swagger.yaml b/api/swagger.yaml index bb6e0b0e45..00a8dd255a 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -1825,18 +1825,22 @@ definitions: type: "string" description: "Name of the volume." x-nullable: false + example: "tardis" Driver: type: "string" description: "Name of the volume driver used by the volume." x-nullable: false + example: "custom" Mountpoint: type: "string" description: "Mount path of the volume on the host." x-nullable: false + example: "/var/lib/docker/volumes/tardis" CreatedAt: type: "string" format: "dateTime" description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" Status: type: "object" description: | @@ -1848,12 +1852,17 @@ definitions: does not support this feature. additionalProperties: type: "object" + example: + hello: "world" Labels: type: "object" description: "User-defined key/value metadata." x-nullable: false additionalProperties: type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" Scope: type: "string" description: | @@ -1862,12 +1871,17 @@ definitions: default: "local" x-nullable: false enum: ["local", "global"] + example: "local" Options: type: "object" description: | The driver specific options used when creating the volume. additionalProperties: type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" UsageData: type: "object" x-nullable: true @@ -1893,18 +1907,6 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false - example: - Name: "tardis" - Driver: "custom" - Mountpoint: "/var/lib/docker/volumes/tardis" - Status: - hello: "world" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - CreatedAt: "2016-06-07T20:31:11.853781916Z" - Network: type: "object" properties: @@ -9007,23 +9009,6 @@ paths: Warnings that occurred when fetching the list of volumes. items: type: "string" - - examples: - application/json: - Volumes: - - CreatedAt: "2017-07-19T12:00:26Z" - Name: "tardis" - Driver: "local" - Mountpoint: "/var/lib/docker/volumes/tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - Options: - device: "tmpfs" - o: "size=100m,uid=1000" - type: "tmpfs" - Warnings: [] 500: description: "Server error" schema: From 5c0aae359fc83fd65fab090a9d19d0dfd266b2db Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 17:30:32 +0100 Subject: [PATCH 2/8] api: docs: move Volume examples inline (v1.39-v1.41) Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.39.yaml | 43 ++++++++++++++----------------------------- docs/api/v1.40.yaml | 43 ++++++++++++++----------------------------- docs/api/v1.41.yaml | 43 ++++++++++++++----------------------------- 3 files changed, 42 insertions(+), 87 deletions(-) diff --git a/docs/api/v1.39.yaml b/docs/api/v1.39.yaml index 27f1b30b2f..a4f72b838d 100644 --- a/docs/api/v1.39.yaml +++ b/docs/api/v1.39.yaml @@ -1732,18 +1732,22 @@ definitions: type: "string" description: "Name of the volume." x-nullable: false + example: "tardis" Driver: type: "string" description: "Name of the volume driver used by the volume." x-nullable: false + example: "custom" Mountpoint: type: "string" description: "Mount path of the volume on the host." x-nullable: false + example: "/var/lib/docker/volumes/tardis" CreatedAt: type: "string" format: "dateTime" description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" Status: type: "object" description: | @@ -1755,12 +1759,17 @@ definitions: does not support this feature. additionalProperties: type: "object" + example: + hello: "world" Labels: type: "object" description: "User-defined key/value metadata." x-nullable: false additionalProperties: type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" Scope: type: "string" description: | @@ -1769,12 +1778,17 @@ definitions: default: "local" x-nullable: false enum: ["local", "global"] + example: "local" Options: type: "object" description: | The driver specific options used when creating the volume. additionalProperties: type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" UsageData: type: "object" x-nullable: true @@ -1800,18 +1814,6 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false - example: - Name: "tardis" - Driver: "custom" - Mountpoint: "/var/lib/docker/volumes/tardis" - Status: - hello: "world" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - CreatedAt: "2016-06-07T20:31:11.853781916Z" - Network: type: "object" properties: @@ -8451,23 +8453,6 @@ paths: Warnings that occurred when fetching the list of volumes. items: type: "string" - - examples: - application/json: - Volumes: - - CreatedAt: "2017-07-19T12:00:26Z" - Name: "tardis" - Driver: "local" - Mountpoint: "/var/lib/docker/volumes/tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - Options: - device: "tmpfs" - o: "size=100m,uid=1000" - type: "tmpfs" - Warnings: [] 500: description: "Server error" schema: diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 2052e10218..5f2d73d12b 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -1793,18 +1793,22 @@ definitions: type: "string" description: "Name of the volume." x-nullable: false + example: "tardis" Driver: type: "string" description: "Name of the volume driver used by the volume." x-nullable: false + example: "custom" Mountpoint: type: "string" description: "Mount path of the volume on the host." x-nullable: false + example: "/var/lib/docker/volumes/tardis" CreatedAt: type: "string" format: "dateTime" description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" Status: type: "object" description: | @@ -1816,12 +1820,17 @@ definitions: does not support this feature. additionalProperties: type: "object" + example: + hello: "world" Labels: type: "object" description: "User-defined key/value metadata." x-nullable: false additionalProperties: type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" Scope: type: "string" description: | @@ -1830,12 +1839,17 @@ definitions: default: "local" x-nullable: false enum: ["local", "global"] + example: "local" Options: type: "object" description: | The driver specific options used when creating the volume. additionalProperties: type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" UsageData: type: "object" x-nullable: true @@ -1861,18 +1875,6 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false - example: - Name: "tardis" - Driver: "custom" - Mountpoint: "/var/lib/docker/volumes/tardis" - Status: - hello: "world" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - CreatedAt: "2016-06-07T20:31:11.853781916Z" - Network: type: "object" properties: @@ -8784,23 +8786,6 @@ paths: Warnings that occurred when fetching the list of volumes. items: type: "string" - - examples: - application/json: - Volumes: - - CreatedAt: "2017-07-19T12:00:26Z" - Name: "tardis" - Driver: "local" - Mountpoint: "/var/lib/docker/volumes/tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - Options: - device: "tmpfs" - o: "size=100m,uid=1000" - type: "tmpfs" - Warnings: [] 500: description: "Server error" schema: diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 7beb139cd5..71ca84a42c 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -1825,18 +1825,22 @@ definitions: type: "string" description: "Name of the volume." x-nullable: false + example: "tardis" Driver: type: "string" description: "Name of the volume driver used by the volume." x-nullable: false + example: "custom" Mountpoint: type: "string" description: "Mount path of the volume on the host." x-nullable: false + example: "/var/lib/docker/volumes/tardis" CreatedAt: type: "string" format: "dateTime" description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" Status: type: "object" description: | @@ -1848,12 +1852,17 @@ definitions: does not support this feature. additionalProperties: type: "object" + example: + hello: "world" Labels: type: "object" description: "User-defined key/value metadata." x-nullable: false additionalProperties: type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" Scope: type: "string" description: | @@ -1862,12 +1871,17 @@ definitions: default: "local" x-nullable: false enum: ["local", "global"] + example: "local" Options: type: "object" description: | The driver specific options used when creating the volume. additionalProperties: type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" UsageData: type: "object" x-nullable: true @@ -1893,18 +1907,6 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false - example: - Name: "tardis" - Driver: "custom" - Mountpoint: "/var/lib/docker/volumes/tardis" - Status: - hello: "world" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - CreatedAt: "2016-06-07T20:31:11.853781916Z" - Network: type: "object" properties: @@ -8955,23 +8957,6 @@ paths: Warnings that occurred when fetching the list of volumes. items: type: "string" - - examples: - application/json: - Volumes: - - CreatedAt: "2017-07-19T12:00:26Z" - Name: "tardis" - Driver: "local" - Mountpoint: "/var/lib/docker/volumes/tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Scope: "local" - Options: - device: "tmpfs" - o: "size=100m,uid=1000" - type: "tmpfs" - Warnings: [] 500: description: "Server error" schema: From 0119f7973b75378491653b0e025ca1b63ce58e4f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 15:31:04 +0100 Subject: [PATCH 3/8] api: swagger: move VolumeCreateOptions to definitions Signed-off-by: Sebastiaan van Stijn --- api/swagger.yaml | 71 ++++++++++++++------------ api/types/volume/volume_create.go | 31 ----------- api/types/volume/volume_create_body.go | 26 ++++++++++ hack/generate-swagger-api.sh | 5 +- 4 files changed, 69 insertions(+), 64 deletions(-) delete mode 100644 api/types/volume/volume_create.go create mode 100644 api/types/volume/volume_create_body.go diff --git a/api/swagger.yaml b/api/swagger.yaml index 00a8dd255a..67028c3ba4 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -1907,6 +1907,44 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "VolumeCreateBody" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Network: type: "object" properties: @@ -9053,38 +9091,7 @@ paths: required: true description: "Volume configuration" schema: - type: "object" - description: "Volume configuration" - title: "VolumeConfig" - properties: - Name: - description: | - The new volume's name. If not specified, Docker generates a name. - type: "string" - x-nullable: false - Driver: - description: "Name of the volume driver to use." - type: "string" - default: "local" - x-nullable: false - DriverOpts: - description: | - A mapping of driver options and values. These options are - passed directly to the driver and are driver specific. - type: "object" - additionalProperties: - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - Name: "tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Driver: "custom" + $ref: "#/definitions/VolumeCreateOptions" tags: ["Volume"] /volumes/{name}: diff --git a/api/types/volume/volume_create.go b/api/types/volume/volume_create.go deleted file mode 100644 index 8538078dd6..0000000000 --- a/api/types/volume/volume_create.go +++ /dev/null @@ -1,31 +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 -// ---------------------------------------------------------------------------- - -// VolumeCreateBody Volume configuration -// swagger:model VolumeCreateBody -type VolumeCreateBody struct { - - // Name of the volume driver to use. - // Required: true - Driver string `json:"Driver"` - - // A mapping of driver options and values. These options are - // passed directly to the driver and are driver specific. - // - // Required: true - DriverOpts map[string]string `json:"DriverOpts"` - - // User-defined key/value metadata. - // Required: true - Labels map[string]string `json:"Labels"` - - // The new volume's name. If not specified, Docker generates a name. - // - // Required: true - Name string `json:"Name"` -} diff --git a/api/types/volume/volume_create_body.go b/api/types/volume/volume_create_body.go new file mode 100644 index 0000000000..f40fe1377f --- /dev/null +++ b/api/types/volume/volume_create_body.go @@ -0,0 +1,26 @@ +package volume + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// VolumeCreateBody VolumeConfig +// +// Volume configuration +// swagger:model VolumeCreateBody +type VolumeCreateBody struct { + + // Name of the volume driver to use. + Driver string `json:"Driver,omitempty"` + + // A mapping of driver options and values. These options are + // passed directly to the driver and are driver specific. + // + DriverOpts map[string]string `json:"DriverOpts,omitempty"` + + // User-defined key/value metadata. + Labels map[string]string `json:"Labels,omitempty"` + + // The new volume's name. If not specified, Docker generates a name. + // + Name string `json:"Name,omitempty"` +} diff --git a/hack/generate-swagger-api.sh b/hack/generate-swagger-api.sh index 90a01df027..9a54cf9c97 100755 --- a/hack/generate-swagger-api.sh +++ b/hack/generate-swagger-api.sh @@ -13,6 +13,10 @@ swagger generate model -f api/swagger.yaml \ -n ServiceUpdateResponse \ -n Volume +swagger generate model -f api/swagger.yaml \ + -t api -m types/volume --skip-validator -C api/swagger-gen.yaml \ + -n VolumeCreateOptions + swagger generate operation -f api/swagger.yaml \ -t api -a types -m types -C api/swagger-gen.yaml \ -T api/templates --skip-responses --skip-parameters --skip-validator \ @@ -23,5 +27,4 @@ swagger generate operation -f api/swagger.yaml \ -n ContainerUpdate \ -n ContainerWait \ -n ImageHistory \ - -n VolumeCreate \ -n VolumeList From 444b27910c8e9011354c57140c009a49a41faa78 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 17:39:10 +0100 Subject: [PATCH 4/8] api: docs: move VolumeCreateOptions to definitions (v1.39-v1.41) Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.39.yaml | 71 +++++++++++++++++++++++++-------------------- docs/api/v1.40.yaml | 71 +++++++++++++++++++++++++-------------------- docs/api/v1.41.yaml | 71 +++++++++++++++++++++++++-------------------- 3 files changed, 117 insertions(+), 96 deletions(-) diff --git a/docs/api/v1.39.yaml b/docs/api/v1.39.yaml index a4f72b838d..8060baa30c 100644 --- a/docs/api/v1.39.yaml +++ b/docs/api/v1.39.yaml @@ -1814,6 +1814,44 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "VolumeCreateBody" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Network: type: "object" properties: @@ -8497,38 +8535,7 @@ paths: required: true description: "Volume configuration" schema: - type: "object" - description: "Volume configuration" - title: "VolumeConfig" - properties: - Name: - description: | - The new volume's name. If not specified, Docker generates a name. - type: "string" - x-nullable: false - Driver: - description: "Name of the volume driver to use." - type: "string" - default: "local" - x-nullable: false - DriverOpts: - description: | - A mapping of driver options and values. These options are - passed directly to the driver and are driver specific. - type: "object" - additionalProperties: - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - Name: "tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Driver: "custom" + $ref: "#/definitions/VolumeCreateOptions" tags: ["Volume"] /volumes/{name}: diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 5f2d73d12b..81c7080ce3 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -1875,6 +1875,44 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "VolumeCreateBody" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Network: type: "object" properties: @@ -8830,38 +8868,7 @@ paths: required: true description: "Volume configuration" schema: - type: "object" - description: "Volume configuration" - title: "VolumeConfig" - properties: - Name: - description: | - The new volume's name. If not specified, Docker generates a name. - type: "string" - x-nullable: false - Driver: - description: "Name of the volume driver to use." - type: "string" - default: "local" - x-nullable: false - DriverOpts: - description: | - A mapping of driver options and values. These options are - passed directly to the driver and are driver specific. - type: "object" - additionalProperties: - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - Name: "tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Driver: "custom" + $ref: "#/definitions/VolumeCreateOptions" tags: ["Volume"] /volumes/{name}: diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 71ca84a42c..1ac76946a6 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -1907,6 +1907,44 @@ definitions: is set to `-1` if the reference-count is not available. x-nullable: false + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "VolumeCreateBody" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Network: type: "object" properties: @@ -9001,38 +9039,7 @@ paths: required: true description: "Volume configuration" schema: - type: "object" - description: "Volume configuration" - title: "VolumeConfig" - properties: - Name: - description: | - The new volume's name. If not specified, Docker generates a name. - type: "string" - x-nullable: false - Driver: - description: "Name of the volume driver to use." - type: "string" - default: "local" - x-nullable: false - DriverOpts: - description: | - A mapping of driver options and values. These options are - passed directly to the driver and are driver specific. - type: "object" - additionalProperties: - type: "string" - Labels: - description: "User-defined key/value metadata." - type: "object" - additionalProperties: - type: "string" - example: - Name: "tardis" - Labels: - com.example.some-label: "some-value" - com.example.some-other-label: "some-other-value" - Driver: "custom" + $ref: "#/definitions/VolumeCreateOptions" tags: ["Volume"] /volumes/{name}: From e4c6ca36aea01bfebe34d09c728e60ebe35a0442 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 17:02:03 +0100 Subject: [PATCH 5/8] api: swagger: move ContainerWaitResponse to definitions This should help with CI being unstable when generating the types (due to Go randomizing order). Unfortunately, the (file) names are a bit ugly, but addressing that in a follow-up. Signed-off-by: Sebastiaan van Stijn --- api/swagger.yaml | 40 +++++++++++-------- api/types/container/container_wait.go | 28 ------------- .../container/container_wait_o_k_body.go | 19 +++++++++ .../container_wait_o_k_body_error.go | 12 ++++++ hack/generate-swagger-api.sh | 6 ++- 5 files changed, 60 insertions(+), 45 deletions(-) delete mode 100644 api/types/container/container_wait.go create mode 100644 api/types/container/container_wait_o_k_body.go create mode 100644 api/types/container/container_wait_o_k_body_error.go diff --git a/api/swagger.yaml b/api/swagger.yaml index 67028c3ba4..1c799db4b8 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -4460,6 +4460,29 @@ definitions: Health: $ref: "#/definitions/Health" + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "ContainerWaitOKBody" + title: "ContainerWaitResponse" + required: [StatusCode, Error] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "ContainerWaitOKBodyError" + properties: + Message: + description: "Details of an error" + type: "string" + SystemVersion: type: "object" description: | @@ -7192,22 +7215,7 @@ paths: 200: description: "The container has exit." schema: - type: "object" - title: "ContainerWaitResponse" - description: "OK response to ContainerWait operation" - required: [StatusCode] - properties: - StatusCode: - description: "Exit code of the container" - type: "integer" - x-nullable: false - Error: - description: "container waiting error, if any" - type: "object" - properties: - Message: - description: "Details of an error" - type: "string" + $ref: "#/definitions/ContainerWaitResponse" 400: description: "bad parameter" schema: diff --git a/api/types/container/container_wait.go b/api/types/container/container_wait.go deleted file mode 100644 index 49e05ae669..0000000000 --- a/api/types/container/container_wait.go +++ /dev/null @@ -1,28 +0,0 @@ -package container // import "github.com/docker/docker/api/types/container" - -// ---------------------------------------------------------------------------- -// Code generated by `swagger generate operation`. DO NOT EDIT. -// -// See hack/generate-swagger-api.sh -// ---------------------------------------------------------------------------- - -// ContainerWaitOKBodyError container waiting error, if any -// swagger:model ContainerWaitOKBodyError -type ContainerWaitOKBodyError struct { - - // Details of an error - Message string `json:"Message,omitempty"` -} - -// ContainerWaitOKBody OK response to ContainerWait operation -// swagger:model ContainerWaitOKBody -type ContainerWaitOKBody struct { - - // error - // Required: true - Error *ContainerWaitOKBodyError `json:"Error"` - - // Exit code of the container - // Required: true - StatusCode int64 `json:"StatusCode"` -} diff --git a/api/types/container/container_wait_o_k_body.go b/api/types/container/container_wait_o_k_body.go new file mode 100644 index 0000000000..3219207fbb --- /dev/null +++ b/api/types/container/container_wait_o_k_body.go @@ -0,0 +1,19 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ContainerWaitOKBody ContainerWaitResponse +// +// OK response to ContainerWait operation +// swagger:model ContainerWaitOKBody +type ContainerWaitOKBody struct { + + // error + // Required: true + Error *ContainerWaitOKBodyError `json:"Error"` + + // Exit code of the container + // Required: true + StatusCode int64 `json:"StatusCode"` +} diff --git a/api/types/container/container_wait_o_k_body_error.go b/api/types/container/container_wait_o_k_body_error.go new file mode 100644 index 0000000000..ee598973ec --- /dev/null +++ b/api/types/container/container_wait_o_k_body_error.go @@ -0,0 +1,12 @@ +package container + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ContainerWaitOKBodyError container waiting error, if any +// swagger:model ContainerWaitOKBodyError +type ContainerWaitOKBodyError struct { + + // Details of an error + Message string `json:"Message,omitempty"` +} diff --git a/hack/generate-swagger-api.sh b/hack/generate-swagger-api.sh index 9a54cf9c97..e300212e35 100755 --- a/hack/generate-swagger-api.sh +++ b/hack/generate-swagger-api.sh @@ -13,6 +13,11 @@ swagger generate model -f api/swagger.yaml \ -n ServiceUpdateResponse \ -n Volume +swagger generate model -f api/swagger.yaml \ + -t api -m types/container --skip-validator -C api/swagger-gen.yaml \ + -n ContainerWaitResponse \ + -n ContainerWaitExitError + swagger generate model -f api/swagger.yaml \ -t api -m types/volume --skip-validator -C api/swagger-gen.yaml \ -n VolumeCreateOptions @@ -25,6 +30,5 @@ swagger generate operation -f api/swagger.yaml \ -n ContainerCreate \ -n ContainerTop \ -n ContainerUpdate \ - -n ContainerWait \ -n ImageHistory \ -n VolumeList From 352d1bb8e0cc6329d3137000d6540351c0c02c46 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 22:00:57 +0100 Subject: [PATCH 6/8] api: docs: move ContainerWaitResponse to definitions (v1.39-v1.41) Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.39.yaml | 40 ++++++++++++++++++++++++---------------- docs/api/v1.40.yaml | 40 ++++++++++++++++++++++++---------------- docs/api/v1.41.yaml | 40 ++++++++++++++++++++++++---------------- 3 files changed, 72 insertions(+), 48 deletions(-) diff --git a/docs/api/v1.39.yaml b/docs/api/v1.39.yaml index 8060baa30c..ee5528d974 100644 --- a/docs/api/v1.39.yaml +++ b/docs/api/v1.39.yaml @@ -4181,6 +4181,29 @@ definitions: x-nullable: true $ref: "#/definitions/Health" + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "ContainerWaitOKBody" + title: "ContainerWaitResponse" + required: [StatusCode, Error] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "ContainerWaitOKBodyError" + properties: + Message: + description: "Details of an error" + type: "string" + SystemVersion: type: "object" description: | @@ -6718,22 +6741,7 @@ paths: 200: description: "The container has exit." schema: - type: "object" - title: "ContainerWaitResponse" - description: "OK response to ContainerWait operation" - required: [StatusCode] - properties: - StatusCode: - description: "Exit code of the container" - type: "integer" - x-nullable: false - Error: - description: "container waiting error, if any" - type: "object" - properties: - Message: - description: "Details of an error" - type: "string" + $ref: "#/definitions/ContainerWaitResponse" 400: description: "bad parameter" schema: diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 81c7080ce3..418a5f5597 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -4306,6 +4306,29 @@ definitions: x-nullable: true $ref: "#/definitions/Health" + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "ContainerWaitOKBody" + title: "ContainerWaitResponse" + required: [StatusCode, Error] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "ContainerWaitOKBodyError" + properties: + Message: + description: "Details of an error" + type: "string" + SystemVersion: type: "object" description: | @@ -7024,22 +7047,7 @@ paths: 200: description: "The container has exit." schema: - type: "object" - title: "ContainerWaitResponse" - description: "OK response to ContainerWait operation" - required: [StatusCode] - properties: - StatusCode: - description: "Exit code of the container" - type: "integer" - x-nullable: false - Error: - description: "container waiting error, if any" - type: "object" - properties: - Message: - description: "Details of an error" - type: "string" + $ref: "#/definitions/ContainerWaitResponse" 400: description: "bad parameter" schema: diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 1ac76946a6..3a104c478f 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -4460,6 +4460,29 @@ definitions: x-nullable: true $ref: "#/definitions/Health" + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "ContainerWaitOKBody" + title: "ContainerWaitResponse" + required: [StatusCode, Error] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "ContainerWaitOKBodyError" + properties: + Message: + description: "Details of an error" + type: "string" + SystemVersion: type: "object" description: | @@ -7193,22 +7216,7 @@ paths: 200: description: "The container has exit." schema: - type: "object" - title: "ContainerWaitResponse" - description: "OK response to ContainerWait operation" - required: [StatusCode] - properties: - StatusCode: - description: "Exit code of the container" - type: "integer" - x-nullable: false - Error: - description: "container waiting error, if any" - type: "object" - properties: - Message: - description: "Details of an error" - type: "string" + $ref: "#/definitions/ContainerWaitResponse" 400: description: "bad parameter" schema: From a4567903a80fabbc86c7dc97ec4aa9621b40bd37 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 22:03:57 +0100 Subject: [PATCH 7/8] api: swagger: fix indentation of HostConfig.SecurityOpt Signed-off-by: Sebastiaan van Stijn --- api/swagger.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/swagger.yaml b/api/swagger.yaml index 1c799db4b8..3ea7d399ea 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -1027,8 +1027,9 @@ definitions: description: "Mount the container's root filesystem as read only." SecurityOpt: type: "array" - description: "A list of string values to customize labels for MLS - systems, such as SELinux." + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. items: type: "string" StorageOpt: From 0759f013a418e8bee58fc3619486e56d8e7be77c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Mar 2022 22:07:50 +0100 Subject: [PATCH 8/8] api: docs: fix indentation of HostConfig.SecurityOpt (v1.39-v1.41) Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.39.yaml | 5 +++-- docs/api/v1.40.yaml | 5 +++-- docs/api/v1.41.yaml | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/api/v1.39.yaml b/docs/api/v1.39.yaml index ee5528d974..30a4fd3288 100644 --- a/docs/api/v1.39.yaml +++ b/docs/api/v1.39.yaml @@ -934,8 +934,9 @@ definitions: description: "Mount the container's root filesystem as read only." SecurityOpt: type: "array" - description: "A list of string values to customize labels for MLS - systems, such as SELinux." + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. items: type: "string" StorageOpt: diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 418a5f5597..b62cf20c4b 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -995,8 +995,9 @@ definitions: description: "Mount the container's root filesystem as read only." SecurityOpt: type: "array" - description: "A list of string values to customize labels for MLS - systems, such as SELinux." + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. items: type: "string" StorageOpt: diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 3a104c478f..a747152a0f 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -1027,8 +1027,9 @@ definitions: description: "Mount the container's root filesystem as read only." SecurityOpt: type: "array" - description: "A list of string values to customize labels for MLS - systems, such as SELinux." + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. items: type: "string" StorageOpt: