diff --git a/api/swagger.yaml b/api/swagger.yaml index 70526ca663..9dac7a21e5 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -4617,6 +4617,26 @@ definitions: Health: $ref: "#/definitions/Health" + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "ContainerCreateCreatedBody" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + ContainerWaitResponse: description: "OK response to ContainerWait operation" type: "object" @@ -6081,25 +6101,7 @@ paths: 201: description: "Container created successfully" schema: - type: "object" - title: "ContainerCreateResponse" - description: "OK response to ContainerCreate operation" - required: [Id, Warnings] - properties: - Id: - description: "The ID of the created container" - type: "string" - x-nullable: false - Warnings: - description: "Warnings encountered when creating the container" - type: "array" - x-nullable: false - items: - type: "string" - examples: - application/json: - Id: "e90e34656806" - Warnings: [] + $ref: "#/definitions/ContainerCreateResponse" 400: description: "bad parameter" schema: diff --git a/api/types/container/container_create.go b/api/types/container/container_create.go deleted file mode 100644 index d0c852f84d..0000000000 --- a/api/types/container/container_create.go +++ /dev/null @@ -1,20 +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 -// ---------------------------------------------------------------------------- - -// ContainerCreateCreatedBody OK response to ContainerCreate operation -// swagger:model ContainerCreateCreatedBody -type ContainerCreateCreatedBody struct { - - // The ID of the created container - // Required: true - ID string `json:"Id"` - - // Warnings encountered when creating the container - // Required: true - Warnings []string `json:"Warnings"` -} diff --git a/api/types/container/container_create_created_body.go b/api/types/container/container_create_created_body.go new file mode 100644 index 0000000000..88df14a0eb --- /dev/null +++ b/api/types/container/container_create_created_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 + +// ContainerCreateCreatedBody ContainerCreateResponse +// +// OK response to ContainerCreate operation +// swagger:model ContainerCreateCreatedBody +type ContainerCreateCreatedBody struct { + + // The ID of the created container + // Required: true + ID string `json:"Id"` + + // Warnings encountered when creating the container + // Required: true + Warnings []string `json:"Warnings"` +} diff --git a/hack/generate-swagger-api.sh b/hack/generate-swagger-api.sh index 95a0bf103e..8a4832cbde 100755 --- a/hack/generate-swagger-api.sh +++ b/hack/generate-swagger-api.sh @@ -18,6 +18,7 @@ swagger generate model -f api/swagger.yaml \ swagger generate model -f api/swagger.yaml \ -t api -m types/container --skip-validator -C api/swagger-gen.yaml \ + -n ContainerCreateResponse \ -n ContainerWaitResponse \ -n ContainerWaitExitError @@ -32,7 +33,6 @@ swagger generate operation -f api/swagger.yaml \ -T api/templates --skip-responses --skip-parameters --skip-validator \ -n Authenticate \ -n ContainerChanges \ - -n ContainerCreate \ -n ContainerTop \ -n ContainerUpdate \ -n ImageHistory