mirror of
https://github.com/project-zot/zot.git
synced 2026-06-18 05:28:07 +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
+25
-2
@@ -30,6 +30,7 @@ import (
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/opencontainers/distribution-spec/specs-go/v1/extensions"
|
||||
godigest "github.com/opencontainers/go-digest"
|
||||
specs "github.com/opencontainers/image-spec/specs-go"
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/zitadel/oidc/v3/pkg/client/rp"
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
@@ -499,7 +500,13 @@ func (rh *RouteHandler) CheckManifest(response http.ResponseWriter, request *htt
|
||||
}
|
||||
|
||||
type ImageManifest struct {
|
||||
ispec.Manifest
|
||||
specs.Versioned
|
||||
MediaType string `json:"mediaType,omitempty"`
|
||||
ArtifactType string `json:"artifactType,omitempty"`
|
||||
Config ImageDescriptor `json:"config"`
|
||||
Layers []ImageDescriptor `json:"layers"`
|
||||
Subject *ImageDescriptor `json:"subject,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
}
|
||||
|
||||
type ExtensionList struct {
|
||||
@@ -587,7 +594,23 @@ func (rh *RouteHandler) GetManifest(response http.ResponseWriter, request *http.
|
||||
}
|
||||
|
||||
type ImageIndex struct {
|
||||
ispec.Index
|
||||
specs.Versioned
|
||||
MediaType string `json:"mediaType,omitempty"`
|
||||
ArtifactType string `json:"artifactType,omitempty"`
|
||||
Manifests []ImageDescriptor `json:"manifests"`
|
||||
Subject *ImageDescriptor `json:"subject,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
}
|
||||
|
||||
type ImageDescriptor struct {
|
||||
MediaType string `json:"mediaType"`
|
||||
Digest string `json:"digest"`
|
||||
Size int64 `json:"size"`
|
||||
URLs []string `json:"urls,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
Data []byte `json:"data,omitempty"`
|
||||
Platform *ispec.Platform `json:"platform,omitempty"`
|
||||
ArtifactType string `json:"artifactType,omitempty"`
|
||||
}
|
||||
|
||||
func getReferrers(ctx context.Context, routeHandler *RouteHandler,
|
||||
|
||||
Reference in New Issue
Block a user