diff --git a/doc/specification/formats/compdesc/v2/README.md b/doc/specification/formats/compdesc/v2/README.md index 70c222b..aafdb97 100644 --- a/doc/specification/formats/compdesc/v2/README.md +++ b/doc/specification/formats/compdesc/v2/README.md @@ -1,6 +1,6 @@ # Component Descriptor Serialization Version V2 -A *Component Descriptor* of version v2 is a [YAML](https://yaml.org/) or [JSON](https://www.json.org/json-en.html) document according to this [schema](json-schema.yaml). Additional fields are not allowed. +A *Component Descriptor* of version v2 is a [YAML](https://yaml.org/) or [JSON](https://www.json.org/json-en.html) document according to this [schema](https://github.com/open-component-model/ocm/blob/main/resources/component-descriptor-v2-schema.yaml). Additional fields are not allowed. Note that the schemas are maintained in a different Git repository. In serialised form, *Component Descriptors* MUST be UTF-8-encoded. Either YAML, or JSON MUST be used. If YAML is used as serialisation format, only the subset of features defined by JSON MUST be used, thus allowing conversion to a JSON representation. diff --git a/doc/specification/formats/compdesc/v2/json-schema.yaml b/doc/specification/formats/compdesc/v2/json-schema.yaml deleted file mode 100644 index 8489121..0000000 --- a/doc/specification/formats/compdesc/v2/json-schema.yaml +++ /dev/null @@ -1,460 +0,0 @@ -$id: 'https://ocm.software/schemas/component-descriptor-v2' -$schema: 'https://json-schema.org/draft/2020-12/schema' -description: 'Open Component Model v2 schema' -definitions: - meta: - type: 'object' - description: 'component descriptor metadata' - required: - - 'schemaVersion' - properties: - schemaVersion: - type: 'string' - - label: - type: 'object' - required: - - 'name' - - 'value' - properties: - name: - type: 'string' - value: {} - version: - pattern: '^v[0-9]+$' - signing: - type: 'boolean' - - componentName: - type: 'string' - maxLength: 255 - pattern: '^[a-z][-a-z0-9]*([.][a-z][-a-z0-9]*)*[.][a-z]{2,}(/[a-z][-a-z0-9_]*([.][a-z][-a-z0-9_]*)*)+$' - - identityAttributeKey: - minLength: 2 - pattern: '^[a-z0-9]([-_+a-z0-9]*[a-z0-9])?$' - - relaxedSemver: - # taken from semver.org and adjusted to allow an optional leading 'v', major-only, and major.minor-only - # this means the following strings are all valid relaxedSemvers: - # 1.2.3 - # 1.2.3-foo+bar - # v1.2.3 - # v1.2.3-foo+bar - # 1.2 - # 1 - # v1 - # v1.2 - # v1-foo+bar - pattern: '^[v]?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' - type: 'string' - - identityAttribute: - type: 'object' - propertyNames: { $ref: '#/definitions/identityAttributeKey' } - - repositoryContext: - type: 'object' - required: - - 'type' - properties: - type: - type: 'string' - - ociRepositoryContext: - allOf: - - $ref: '#/definitions/repositoryContext' - - required: - - 'baseUrl' - properties: - baseUrl: - type: 'string' - componentNameMapping: - type: 'string' - enum: ['urlPath', 'sha256-digest'] - type: - type: 'string' - enum: ['ociRegistry', 'OCIRegistry'] - - access: - type: 'object' - description: 'base type for accesses (for extensions)' - required: - - 'type' - - githubAccess: - type: 'object' - required: - - 'type' - - 'repoUrl' - - 'ref' - properties: - type: - type: 'string' - enum: ['github'] - repoUrl: - type: 'string' - ref: - type: 'string' - commit: - type: 'string' - - noneAccess: - type: 'object' - required: - - 'type' - properties: - type: - type: 'string' - enum: ['None'] - - sourceDefinition: - type: 'object' - required: - - name - - version - - type - - access - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - labels: - type: 'array' - items: - $ref: '#/definitions/label' - access: - anyOf: - - $ref: '#/definitions/access' - - $ref: '#/definitions/githubAccess' - - $ref: '#/definitions/httpAccess' - - digestSpec: - type: 'object' - required: - - hashAlgorithm - - normalisationAlgorithm - - value - properties: - hashAlgorithm: - type: string - normalisationAlgorithm: - type: string - value: - type: string - - signatureSpec: - type: 'object' - required: - - algorithm - - value - - mediaType - properties: - algorithm: - type: string - value: - type: string - mediaType: - description: 'The media type of the signature value' - type: string - - signature: - type: 'object' - required: - - name - - digest - - signature - properties: - name: - type: string - digest: - $ref: '#/definitions/digestSpec' - signature: - $ref: '#/definitions/signatureSpec' - - srcRef: - type: 'object' - description: 'a reference to a (component-local) source' - properties: - identitySelector: - $ref: '#/definitions/identityAttribute' - labels: - type: 'array' - items: - $ref: '#/definitions/label' - - componentReference: - type: 'object' - description: 'a reference to a component' - required: - - 'name' - - 'componentName' - - 'version' - properties: - componentName: - $ref: '#/definitions/componentName' - name: - type: 'string' # actually: component-type w/ special restrictions - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - labels: - type: 'array' - items: - $ref: '#/definitions/label' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - resourceType: - type: 'object' - description: 'base type for resources' - required: - - 'name' - - 'version' # for local resources, this must match component's version - - 'type' - - 'relation' - - 'access' - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - srcRefs: - type: 'array' - items: - $ref: '#/definitions/srcRef' - relation: - type: 'string' - enum: ['local', 'external'] - labels: - type: 'array' - items: - $ref: '#/definitions/label' - access: - anyOf: - - $ref: '#/definitions/access' - - $ref: '#/definitions/ociBlobAccess' - - $ref: '#/definitions/localFilesystemBlobAccess' - - $ref: '#/definitions/localOciBlobAccess' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - ociImageAccess: - type: 'object' - required: - - 'type' - - 'imageReference' - properties: - type: - type: 'string' - enum: ['ociRegistry'] - imageReference: - type: 'string' - - ociBlobAccess: - type: 'object' - required: - - 'type' - - 'layer' - properties: - type: - type: 'string' - enum: [ 'ociBlob' ] - ref: - description: 'A oci reference to the manifest' - type: 'string' - mediaType: - description: 'The media type of the object this access refers to' - type: 'string' - digest: - description: 'The digest of the targeted content' - type: 'string' - size: - description: 'The size in bytes of the blob' - type: 'number' - - localFilesystemBlobAccess: - type: 'object' - required: - - 'type' - - 'filename' - properties: - type: - type: 'string' - enum: [ 'localFilesystemBlob' ] - filename: - description: 'filename of the blob that is located in the "blobs" directory' - type: 'string' - - localOciBlobAccess: - type: 'object' - required: - - 'type' - - 'filename' - properties: - type: - type: 'string' - enum: [ 'localOciBlob' ] - digest: - description: 'digest of the layer within the current component descriptor' - type: 'string' - - ociImageResource: - type: 'object' - required: - - 'name' - - 'version' - - 'type' - - 'access' - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - enum: ['ociImage'] - labels: - type: 'array' - items: - $ref: '#/definitions/label' - access: - $ref: '#/definitions/ociImageAccess' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - - httpAccess: - type: 'object' - required: - - 'type' - - 'url' - properties: - type: - type: 'string' - enum: ['http'] - url: - type: 'string' - - genericAccess: - type: 'object' - required: - - 'type' - properties: - type: - type: 'string' - enum: ['generic'] - - genericResource: - type: 'object' - required: - - 'name' - - 'version' - - 'type' - - 'access' - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - enum: ['generic'] - labels: - type: 'array' - items: - $ref: '#/definitions/label' - access: - $ref: '#/definitions/genericAccess' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - component: - type: 'object' - description: 'a component' - required: - - 'name' - - 'version' - - 'repositoryContexts' - - 'provider' - - 'sources' - - 'componentReferences' - - 'resources' - properties: - name: - $ref: '#/definitions/componentName' - version: - $ref: '#/definitions/relaxedSemver' - creationTime: - type: string - format: date-time - repositoryContexts: - type: 'array' - items: - anyOf: - - $ref: '#/definitions/ociRepositoryContext' # currently, we only allow this one - provider: - type: 'string' - labels: - type: 'array' - items: - $ref: '#/definitions/label' - sources: - type: 'array' - items: - $ref: '#/definitions/sourceDefinition' - componentReferences: - type: 'array' - items: - $ref: '#/definitions/componentReference' - resources: - type: 'array' - items: - anyOf: - - $ref: '#/definitions/resourceType' - - $ref: '#/definitions/ociImageResource' - - $ref: '#/definitions/genericResource' - - componentReferences: {} - - -type: 'object' -required: - - 'meta' - - 'component' -properties: - meta: - $ref: '#/definitions/meta' - component: - $ref: '#/definitions/component' - signatures: - type: 'array' - items: - $ref: '#/definitions/signature' \ No newline at end of file diff --git a/doc/specification/formats/compdesc/v3alpha1/README.md b/doc/specification/formats/compdesc/v3alpha1/README.md index 83edc26..5ca7eb2 100644 --- a/doc/specification/formats/compdesc/v3alpha1/README.md +++ b/doc/specification/formats/compdesc/v3alpha1/README.md @@ -1,2 +1,4 @@ # Component Descriptor Serialization Version V3alpha1 -The component descriptor V2 is specified in this [schema](json-schema.yaml). +The component descriptor V2 is specified in this [schema](https://github.com/open-component-model/ocm/blob/main/resources/component-descriptor-ocm-v3-schema.yaml). + +Note that the schemas are maintained in a different Git repository. diff --git a/doc/specification/formats/compdesc/v3alpha1/json-schema.yaml b/doc/specification/formats/compdesc/v3alpha1/json-schema.yaml deleted file mode 100644 index 087c892..0000000 --- a/doc/specification/formats/compdesc/v3alpha1/json-schema.yaml +++ /dev/null @@ -1,464 +0,0 @@ -$id: 'https://ocm.software/schemas/component-descriptor-ocm-v3alpha1' -$schema: 'https://json-schema.org/draft/2020-12/schema' -description: 'OCM Component Descriptor v3 schema' -definitions: - meta: - type: 'object' - description: 'component version metadata' - required: - - 'name' - - 'version' - additionalProperties: false - properties: - name: - $ref: '#/definitions/componentName' - version: - $ref: '#/definitions/relaxedSemver' - labels: - $ref: '#/definitions/labels' - provider: - $ref: '#/definitions/provider' - creationTime: - type: string - format: date-time - labels: - type: 'array' - items: - $ref: '#/definitions/label' - label: - type: 'object' - required: - - 'name' - - 'value' - properties: - name: - type: string - value: {} - version: - pattern: '^v[0-9]+$' - signing: - type: 'boolean' - additionalProperties: false - - componentName: - type: 'string' - maxLength: 255 - pattern: '^[a-z][-a-z0-9]*([.][a-z][-a-z0-9]*)*[.][a-z]{2,}(/[a-z][-a-z0-9_]*([.][a-z][-a-z0-9_]*)*)+$' - - identityAttributeKey: - minLength: 2 - pattern: '^[a-z0-9]([-_+a-z0-9]*[a-z0-9])?$' - - relaxedSemver: - # taken from semver.org and adjusted to allow an optional leading 'v', major-only, and major.minor-only - # this means the following strings are all valid relaxedSemvers: - # 1.2.3 - # 1.2.3-foo+bar - # v1.2.3 - # v1.2.3-foo+bar - # 1.2 - # 1 - # v1 - # v1.2 - # v1-foo+bar - pattern: '^[v]?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' - type: 'string' - - identityAttribute: - type: 'object' - propertyNames: { $ref: '#/definitions/identityAttributeKey' } - - repositoryContext: - type: 'object' - required: - - 'type' - properties: - type: - type: 'string' - - ociRepositoryContext: - allOf: - - $ref: '#/definitions/repositoryContext' - - required: - - 'baseUrl' - properties: - baseUrl: - type: 'string' - componentNameMapping: - type: 'string' - enum: ['urlPath', 'sha256-digest'] - type: - type: 'string' - enum: ['ociRegistry', 'OCIRegistry'] - - access: - type: 'object' - description: 'base type for accesses (for extensions)' - required: - - 'type' - - githubAccess: - type: 'object' - required: - - 'type' - - 'repoUrl' - - 'ref' - properties: - type: - type: 'string' - enum: ['github'] - repoUrl: - type: 'string' - ref: - type: 'string' - commit: - type: 'string' - - noneAccess: - type: 'object' - required: - - 'type' - properties: - type: - type: 'string' - enum: ['None'] - - sourceDefinition: - type: 'object' - required: - - name - - version - - type - - access - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - labels: - $ref: '#/definitions/labels' - access: - anyOf: - - $ref: '#/definitions/access' - - $ref: '#/definitions/githubAccess' - - $ref: '#/definitions/httpAccess' - - digestSpec: - type: 'object' - required: - - hashAlgorithm - - normalisationAlgorithm - - value - additionalProperties: false - properties: - hashAlgorithm: - type: string - normalisationAlgorithm: - type: string - value: - type: string - - signatureSpec: - type: 'object' - required: - - algorithm - - value - - mediaType - additionalProperties: false - properties: - algorithm: - type: string - value: - type: string - mediaType: - description: 'The media type of the signature value' - type: string - - signature: - type: 'object' - required: - - name - - digest - - signature - additionalProperties: false - properties: - name: - type: string - digest: - $ref: '#/definitions/digestSpec' - signature: - $ref: '#/definitions/signatureSpec' - - srcRef: - type: 'object' - description: 'a reference to a (component-local) source' - properties: - identitySelector: - $ref: '#/definitions/identityAttribute' - labels: - $ref: '#/definitions/labels' - - reference: - type: 'object' - description: 'a reference to a component' - required: - - 'name' - - 'componentName' - - 'version' - additionalProperties: false - properties: - componentName: - $ref: '#/definitions/componentName' - name: - type: 'string' # actually: component-type w/ special restrictions - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - labels: - $ref: '#/definitions/labels' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - resourceType: - type: 'object' - description: 'base type for resources' - required: - - 'name' - - 'version' # for local resources, this must match component's version - - 'type' - - 'relation' - - 'access' - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - srcRefs: - type: 'array' - items: - $ref: '#/definitions/srcRef' - relation: - type: 'string' - enum: ['local', 'external'] - labels: - $ref: '#/definitions/labels' - access: - anyOf: - - $ref: '#/definitions/access' - - $ref: '#/definitions/ociBlobAccess' - - $ref: '#/definitions/localFilesystemBlobAccess' - - $ref: '#/definitions/localOciBlobAccess' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - ociImageAccess: - type: 'object' - required: - - 'type' - - 'imageReference' - properties: - type: - type: 'string' - enum: ['ociRegistry'] - imageReference: - type: 'string' - - ociBlobAccess: - type: 'object' - required: - - 'type' - - 'layer' - properties: - type: - type: 'string' - enum: [ 'ociBlob' ] - ref: - description: 'A oci reference to the manifest' - type: 'string' - mediaType: - description: 'The media type of the object this access refers to' - type: 'string' - digest: - description: 'The digest of the targeted content' - type: 'string' - size: - description: 'The size in bytes of the blob' - type: 'number' - - localFilesystemBlobAccess: - type: 'object' - required: - - 'type' - - 'filename' - properties: - type: - type: 'string' - enum: [ 'localFilesystemBlob' ] - filename: - description: 'filename of the blob that is located in the "blobs" directory' - type: 'string' - - localOciBlobAccess: - type: 'object' - required: - - 'type' - - 'filename' - properties: - type: - type: 'string' - enum: [ 'localOciBlob' ] - digest: - description: 'digest of the layer within the current component descriptor' - type: 'string' - - ociImageResource: - type: 'object' - required: - - 'name' - - 'version' - - 'type' - - 'access' - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - enum: ['ociImage'] - labels: - $ref: '#/definitions/labels' - access: - $ref: '#/definitions/ociImageAccess' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - - httpAccess: - type: 'object' - required: - - 'type' - - 'url' - properties: - type: - type: 'string' - enum: ['http'] - url: - type: 'string' - - genericAccess: - type: 'object' - required: - - 'type' - properties: - type: - type: 'string' - enum: ['generic'] - - genericResource: - type: 'object' - required: - - 'name' - - 'version' - - 'type' - - 'access' - additionalProperties: false - properties: - name: - type: 'string' - $ref: '#/definitions/identityAttributeKey' - extraIdentity: - $ref: '#/definitions/identityAttribute' - version: - $ref: '#/definitions/relaxedSemver' - type: - type: 'string' - enum: ['generic'] - labels: - $ref: '#/definitions/labels' - access: - $ref: '#/definitions/genericAccess' - digest: - oneOf: - - type: 'null' - - $ref: '#/definitions/digestSpec' - - provider: - type: 'object' - required: - - 'name' - additionalProperties: false - properties: - name: - type: 'string' - labels: - $ref: '#/definitions/labels' - - spec: - type: 'object' - description: 'specification of the content of a component versiont' - additionalProperties: false - properties: - sources: - type: 'array' - items: - $ref: '#/definitions/sourceDefinition' - references: - type: 'array' - items: - $ref: '#/definitions/reference' - resources: - type: 'array' - items: - anyOf: - - $ref: '#/definitions/resourceType' - - $ref: '#/definitions/ociImageResource' - - $ref: '#/definitions/genericResource' - -type: 'object' -required: - - 'apiVersion' - - 'kind' - - 'metadata' - - 'spec' -properties: - apiVersion: - type: 'string' - enum: [ 'ocm.gardener.cloud/v3alpha1', 'ocm.software/v3alpha1' ] - kind: - type: 'string' - const: 'ComponentVersion' - metadata: - $ref: '#/definitions/meta' - repositoryContexts: - type: 'array' - items: - anyOf: - - $ref: '#/definitions/ociRepositoryContext' # currently, we only allow this one - spec: - $ref: '#/definitions/spec' - signatures: - type: 'array' - items: - $ref: '#/definitions/signature' \ No newline at end of file