diff --git a/pkg/api/routes.go b/pkg/api/routes.go index d4c24e4a..95301d12 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -602,6 +602,8 @@ type ImageIndex struct { Annotations map[string]string `json:"annotations,omitempty"` } +// ImageDescriptor is a swagger-friendly variant of ispec.Descriptor. +// It keeps digest as string to avoid swagger parser issues with external digest.Digest. type ImageDescriptor struct { MediaType string `json:"mediaType"` Digest string `json:"digest"` diff --git a/swagger/docs.go b/swagger/docs.go index 985f5a09..581ce162 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -1264,7 +1264,7 @@ const docTemplate = `{ "type": "string" }, "platform": { - "$ref": "#/definitions/v1.Platform" + "$ref": "#/definitions/github_com_opencontainers_image-spec_specs-go_v1.Platform" }, "size": { "type": "integer" @@ -1481,7 +1481,7 @@ const docTemplate = `{ } } }, - "v1.Platform": { + "github_com_opencontainers_image-spec_specs-go_v1.Platform": { "type": "object", "properties": { "architecture": { diff --git a/swagger/swagger.json b/swagger/swagger.json index 802b02d0..2b74425d 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -1256,7 +1256,7 @@ "type": "string" }, "platform": { - "$ref": "#/definitions/v1.Platform" + "$ref": "#/definitions/github_com_opencontainers_image-spec_specs-go_v1.Platform" }, "size": { "type": "integer" @@ -1473,7 +1473,7 @@ } } }, - "v1.Platform": { + "github_com_opencontainers_image-spec_specs-go_v1.Platform": { "type": "object", "properties": { "architecture": { diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index c16e8b0d..09893ad7 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -34,7 +34,7 @@ definitions: mediaType: type: string platform: - $ref: '#/definitions/v1.Platform' + $ref: '#/definitions/github_com_opencontainers_image-spec_specs-go_v1.Platform' size: type: integer urls: @@ -174,7 +174,7 @@ definitions: releaseTag: type: string type: object - v1.Platform: + github_com_opencontainers_image-spec_specs-go_v1.Platform: properties: architecture: description: |-