diff --git a/api/scripts/generate-swagger-api.sh b/api/scripts/generate-swagger-api.sh index 205614b860..3d3daac76e 100755 --- a/api/scripts/generate-swagger-api.sh +++ b/api/scripts/generate-swagger-api.sh @@ -17,16 +17,6 @@ generate_model() { $(printf -- '--name=%s ' "${MAPFILE[@]}") } -generate_operation() { - mapfile - swagger generate operation --spec="${API_DIR}/swagger.yaml" \ - --target="${API_DIR}" --api-package=types --model-package=types \ - --config-file="${API_DIR}/swagger-gen.yaml" \ - --template-dir="${API_DIR}/templates" --allow-template-override \ - "$@" \ - $(printf -- '--name=%s ' "${MAPFILE[@]}") -} - # /==================================================================\ # | | # | ATTENTION: | @@ -63,6 +53,7 @@ EOT generate_model types/image <<- 'EOT' ImageDeleteResponseItem ImagesDiskUsage + ImageHistoryResponseItem EOT # ImageSummary # TODO: Restore when go-swagger is updated @@ -116,12 +107,3 @@ generate_model types/volume <<- 'EOT' EOT #endregion - -#region -------- Operations -------- - -generate_operation --skip-responses --skip-parameters <<- 'EOT' - Authenticate - ImageHistory -EOT - -#endregion diff --git a/api/swagger.yaml b/api/swagger.yaml index 649ec508d8..1dd0172edc 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -172,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false PortSummary: type: "object" description: | @@ -409,12 +437,12 @@ definitions: default: false ReadOnlyNonRecursive: description: | - Make the mount non-recursively read-only, but still leave the mount recursive - (unless NonRecursive is set to `true` in conjunction). + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). - Added in v1.44, before that version all read-only mounts were - non-recursive by default. To match the previous behaviour this - will default to `true` for clients on versions prior to v1.44. + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. type: "boolean" default: false ReadOnlyForceRecursive: @@ -1783,15 +1811,15 @@ definitions: $ref: "#/definitions/OCIDescriptor" Manifests: description: | - Manifests is a list of image manifests available in this image. It - provides a more detailed view of the platform-specific image manifests or - other image-attached data like build attestations. + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. - Only available if the daemon provides a multi-platform image store - and the `manifests` option is set in the inspect request. + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. - WARNING: This is experimental and may change at any time without any backward - compatibility. + WARNING: This is experimental and may change at any time without any backward + compatibility. type: "array" x-nullable: true items: @@ -9821,33 +9849,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" diff --git a/api/types/image/image_history.go b/api/types/image/history_response_item.go similarity index 59% rename from api/types/image/image_history.go rename to api/types/image/history_response_item.go index 648ba779e5..3de3181ab9 100644 --- a/api/types/image/image_history.go +++ b/api/types/image/history_response_item.go @@ -2,13 +2,12 @@ package image -// ---------------------------------------------------------------------------- -// Code generated by `swagger generate operation`. -// -// See hack/generate-swagger-api.sh -// ---------------------------------------------------------------------------- +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command -// HistoryResponseItem individual image layer information in response to ImageHistory operation +// HistoryResponseItem HistoryResponseItem +// +// individual image layer information in response to ImageHistory operation // // swagger:model HistoryResponseItem type HistoryResponseItem struct { diff --git a/vendor/github.com/moby/moby/api/types/image/image_history.go b/vendor/github.com/moby/moby/api/types/image/history_response_item.go similarity index 59% rename from vendor/github.com/moby/moby/api/types/image/image_history.go rename to vendor/github.com/moby/moby/api/types/image/history_response_item.go index 648ba779e5..3de3181ab9 100644 --- a/vendor/github.com/moby/moby/api/types/image/image_history.go +++ b/vendor/github.com/moby/moby/api/types/image/history_response_item.go @@ -2,13 +2,12 @@ package image -// ---------------------------------------------------------------------------- -// Code generated by `swagger generate operation`. -// -// See hack/generate-swagger-api.sh -// ---------------------------------------------------------------------------- +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command -// HistoryResponseItem individual image layer information in response to ImageHistory operation +// HistoryResponseItem HistoryResponseItem +// +// individual image layer information in response to ImageHistory operation // // swagger:model HistoryResponseItem type HistoryResponseItem struct {