oras-project / artifacts-spec

Apache License 2.0
63 stars 30 forks source link

Question: Media type field required in artifact manifest? #100

Closed michaelb990 closed 2 years ago

michaelb990 commented 2 years ago

I believe it should be, but it currently reads differently than the other fields. The description of mediaType is:

This field contains the mediaType of this document, differentiating from image-manifest and image-index. The mediaType for this manifest type MUST be application/vnd.cncf.oras.artifact.manifest.v1+json, where the version WILL change to reflect newer versions.

vs e.g. artifactType

The REQUIRED artifactType is a unique value, as registered with iana.org. The artifactType values are equivalent to the values used in the manifest.config.mediaType in OCI Artifacts. Examples include sbom/example, application/vnd.cncf.notary.v2. For details on creating a unique artifactType, see OCI Artifact Authors Guidance

The OCI image manifest & image index specs both require manifest media type to be present and I believe the artifact manifest should also require this field. If that opinion is shared by others, I will submit a PR to add a REQUIRED note to the description of the mediaType field in the artifact manifest.

Thanks!

SteveLasker commented 2 years ago

That makes sense, thanks @michaelb990

sajayantony commented 2 years ago

+1 it should be REQUIRED given the previous issues of this not being present.