mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
fix(api): make swagger manifest/index schemas parseable by swag
Agent-Logs-Url: https://github.com/project-zot/zot/sessions/5d32009a-59ed-4867-a7d3-39758c16a090 Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
01cd3143b9
commit
b8fcf96335
+44
-79
@@ -1239,29 +1239,63 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.ImageIndex": {
|
||||
"api.ImageDescriptor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"digest": {
|
||||
"type": "string"
|
||||
},
|
||||
"mediaType": {
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"$ref": "#/definitions/v1.Platform"
|
||||
},
|
||||
"size": {
|
||||
"type": "integer"
|
||||
},
|
||||
"urls": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.ImageIndex": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"description": "Annotations contains arbitrary metadata for the image index.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"description": "ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact.",
|
||||
"type": "string"
|
||||
},
|
||||
"manifests": {
|
||||
"description": "Manifests references platform specific manifests.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
},
|
||||
"mediaType": {
|
||||
"description": "MediaType specifies the type of this document data structure e.g. ` + "`" + `application/vnd.oci.image.index.v1+json` + "`" + `",
|
||||
"type": "string"
|
||||
},
|
||||
"schemaVersion": {
|
||||
@@ -1269,12 +1303,7 @@ const docTemplate = `{
|
||||
"type": "integer"
|
||||
},
|
||||
"subject": {
|
||||
"description": "Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1282,33 +1311,24 @@ const docTemplate = `{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"description": "Annotations contains arbitrary metadata for the image manifest.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"description": "ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact.",
|
||||
"type": "string"
|
||||
},
|
||||
"config": {
|
||||
"description": "Config references a configuration object for a container, by digest.\nThe referenced configuration object is a JSON blob that the runtime uses to set up the container.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
},
|
||||
"layers": {
|
||||
"description": "Layers is an indexed list of layers referenced by the manifest.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
},
|
||||
"mediaType": {
|
||||
"description": "MediaType specifies the type of this document data structure e.g. ` + "`" + `application/vnd.oci.image.manifest.v1+json` + "`" + `",
|
||||
"type": "string"
|
||||
},
|
||||
"schemaVersion": {
|
||||
@@ -1316,12 +1336,7 @@ const docTemplate = `{
|
||||
"type": "integer"
|
||||
},
|
||||
"subject": {
|
||||
"description": "Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1466,56 +1481,6 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.Descriptor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"description": "Annotations contains arbitrary metadata relating to the targeted content.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"description": "ArtifactType is the IANA media type of this artifact.",
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"description": "Data is an embedding of the targeted content. This is encoded as a base64\nstring when marshalled to JSON (automatically, by encoding/json). If\npresent, Data can be used directly to avoid fetching the targeted content.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"digest": {
|
||||
"description": "Digest is the digest of the targeted content.",
|
||||
"type": "string"
|
||||
},
|
||||
"mediaType": {
|
||||
"description": "MediaType is the media type of the object this schema refers to.",
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"description": "Platform describes the platform which the image in the manifest runs on.\n\nThis should only be used when referring to a manifest.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Platform"
|
||||
}
|
||||
]
|
||||
},
|
||||
"size": {
|
||||
"description": "Size specifies the size in bytes of the blob.",
|
||||
"type": "integer"
|
||||
},
|
||||
"urls": {
|
||||
"description": "URLs specifies a list of URLs from which this object MAY be downloaded",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.Platform": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
+44
-79
@@ -1231,29 +1231,63 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.ImageIndex": {
|
||||
"api.ImageDescriptor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"digest": {
|
||||
"type": "string"
|
||||
},
|
||||
"mediaType": {
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"$ref": "#/definitions/v1.Platform"
|
||||
},
|
||||
"size": {
|
||||
"type": "integer"
|
||||
},
|
||||
"urls": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.ImageIndex": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"description": "Annotations contains arbitrary metadata for the image index.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"description": "ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact.",
|
||||
"type": "string"
|
||||
},
|
||||
"manifests": {
|
||||
"description": "Manifests references platform specific manifests.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
},
|
||||
"mediaType": {
|
||||
"description": "MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.index.v1+json`",
|
||||
"type": "string"
|
||||
},
|
||||
"schemaVersion": {
|
||||
@@ -1261,12 +1295,7 @@
|
||||
"type": "integer"
|
||||
},
|
||||
"subject": {
|
||||
"description": "Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1274,33 +1303,24 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"description": "Annotations contains arbitrary metadata for the image manifest.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"description": "ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact.",
|
||||
"type": "string"
|
||||
},
|
||||
"config": {
|
||||
"description": "Config references a configuration object for a container, by digest.\nThe referenced configuration object is a JSON blob that the runtime uses to set up the container.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
},
|
||||
"layers": {
|
||||
"description": "Layers is an indexed list of layers referenced by the manifest.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
},
|
||||
"mediaType": {
|
||||
"description": "MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json`",
|
||||
"type": "string"
|
||||
},
|
||||
"schemaVersion": {
|
||||
@@ -1308,12 +1328,7 @@
|
||||
"type": "integer"
|
||||
},
|
||||
"subject": {
|
||||
"description": "Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Descriptor"
|
||||
}
|
||||
]
|
||||
"$ref": "#/definitions/api.ImageDescriptor"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1458,56 +1473,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.Descriptor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"description": "Annotations contains arbitrary metadata relating to the targeted content.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"artifactType": {
|
||||
"description": "ArtifactType is the IANA media type of this artifact.",
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"description": "Data is an embedding of the targeted content. This is encoded as a base64\nstring when marshalled to JSON (automatically, by encoding/json). If\npresent, Data can be used directly to avoid fetching the targeted content.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"digest": {
|
||||
"description": "Digest is the digest of the targeted content.",
|
||||
"type": "string"
|
||||
},
|
||||
"mediaType": {
|
||||
"description": "MediaType is the media type of the object this schema refers to.",
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"description": "Platform describes the platform which the image in the manifest runs on.\n\nThis should only be used when referring to a manifest.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v1.Platform"
|
||||
}
|
||||
]
|
||||
},
|
||||
"size": {
|
||||
"description": "Size specifies the size in bytes of the blob.",
|
||||
"type": "integer"
|
||||
},
|
||||
"urls": {
|
||||
"description": "URLs specifies a list of URLs from which this object MAY be downloaded",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.Platform": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
+30
-71
@@ -17,71 +17,72 @@ definitions:
|
||||
$ref: '#/definitions/extensions.Extension'
|
||||
type: array
|
||||
type: object
|
||||
api.ImageDescriptor:
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
artifactType:
|
||||
type: string
|
||||
data:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
digest:
|
||||
type: string
|
||||
mediaType:
|
||||
type: string
|
||||
platform:
|
||||
$ref: '#/definitions/v1.Platform'
|
||||
size:
|
||||
type: integer
|
||||
urls:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
api.ImageIndex:
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Annotations contains arbitrary metadata for the image index.
|
||||
type: object
|
||||
artifactType:
|
||||
description: ArtifactType specifies the IANA media type of artifact when the
|
||||
manifest is used for an artifact.
|
||||
type: string
|
||||
manifests:
|
||||
description: Manifests references platform specific manifests.
|
||||
items:
|
||||
$ref: '#/definitions/v1.Descriptor'
|
||||
$ref: '#/definitions/api.ImageDescriptor'
|
||||
type: array
|
||||
mediaType:
|
||||
description: MediaType specifies the type of this document data structure
|
||||
e.g. `application/vnd.oci.image.index.v1+json`
|
||||
type: string
|
||||
schemaVersion:
|
||||
description: SchemaVersion is the image manifest schema that this image follows
|
||||
type: integer
|
||||
subject:
|
||||
allOf:
|
||||
- $ref: '#/definitions/v1.Descriptor'
|
||||
description: Subject is an optional link from the image manifest to another
|
||||
manifest forming an association between the image manifest and the other
|
||||
manifest.
|
||||
$ref: '#/definitions/api.ImageDescriptor'
|
||||
type: object
|
||||
api.ImageManifest:
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Annotations contains arbitrary metadata for the image manifest.
|
||||
type: object
|
||||
artifactType:
|
||||
description: ArtifactType specifies the IANA media type of artifact when the
|
||||
manifest is used for an artifact.
|
||||
type: string
|
||||
config:
|
||||
allOf:
|
||||
- $ref: '#/definitions/v1.Descriptor'
|
||||
description: |-
|
||||
Config references a configuration object for a container, by digest.
|
||||
The referenced configuration object is a JSON blob that the runtime uses to set up the container.
|
||||
$ref: '#/definitions/api.ImageDescriptor'
|
||||
layers:
|
||||
description: Layers is an indexed list of layers referenced by the manifest.
|
||||
items:
|
||||
$ref: '#/definitions/v1.Descriptor'
|
||||
$ref: '#/definitions/api.ImageDescriptor'
|
||||
type: array
|
||||
mediaType:
|
||||
description: MediaType specifies the type of this document data structure
|
||||
e.g. `application/vnd.oci.image.manifest.v1+json`
|
||||
type: string
|
||||
schemaVersion:
|
||||
description: SchemaVersion is the image manifest schema that this image follows
|
||||
type: integer
|
||||
subject:
|
||||
allOf:
|
||||
- $ref: '#/definitions/v1.Descriptor'
|
||||
description: Subject is an optional link from the image manifest to another
|
||||
manifest forming an association between the image manifest and the other
|
||||
manifest.
|
||||
$ref: '#/definitions/api.ImageDescriptor'
|
||||
type: object
|
||||
api.LogoutResponse:
|
||||
properties:
|
||||
@@ -173,48 +174,6 @@ definitions:
|
||||
releaseTag:
|
||||
type: string
|
||||
type: object
|
||||
v1.Descriptor:
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Annotations contains arbitrary metadata relating to the targeted
|
||||
content.
|
||||
type: object
|
||||
artifactType:
|
||||
description: ArtifactType is the IANA media type of this artifact.
|
||||
type: string
|
||||
data:
|
||||
description: |-
|
||||
Data is an embedding of the targeted content. This is encoded as a base64
|
||||
string when marshalled to JSON (automatically, by encoding/json). If
|
||||
present, Data can be used directly to avoid fetching the targeted content.
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
digest:
|
||||
description: Digest is the digest of the targeted content.
|
||||
type: string
|
||||
mediaType:
|
||||
description: MediaType is the media type of the object this schema refers
|
||||
to.
|
||||
type: string
|
||||
platform:
|
||||
allOf:
|
||||
- $ref: '#/definitions/v1.Platform'
|
||||
description: |-
|
||||
Platform describes the platform which the image in the manifest runs on.
|
||||
|
||||
This should only be used when referring to a manifest.
|
||||
size:
|
||||
description: Size specifies the size in bytes of the blob.
|
||||
type: integer
|
||||
urls:
|
||||
description: URLs specifies a list of URLs from which this object MAY be downloaded
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
v1.Platform:
|
||||
properties:
|
||||
architecture:
|
||||
|
||||
Reference in New Issue
Block a user