oras-project / oras-py

ORAS Python SDK
https://oras-project.github.io/oras-py/
Apache License 2.0
40 stars 36 forks source link

docs: use valid media_type format in examples #139

Closed tarilabs closed 5 months ago

tarilabs commented 6 months ago

Hi 👋 proposing with this PR to make documentation media_type examples adhere to the MIME type/Media Type format specification.

Some OCI registry (such as Zot) seems to me they enable by default the validation of media-type according to the standard. The current examples in the doc don't respect the standard, making the examples fail at runtime. e.g.

{"level":"error","error":"[layers.0.mediaType: Does not match pattern '^[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}/[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}$']","goroutine":242,"caller":"zotregistry.dev/zot/pkg/storage/common/common.go:87","time":"2024-06-05T14:26:36.160643+02:00","message":"failed to validate OCIv1 image manifest schema"}

The proposed modification in this PR make use of media_type examples which adhere to the MIME type/Media Type format spec, thus avoiding the validation error from the server/OCI registry side.

vsoch commented 6 months ago

This looks good @tarilabs - not sure why the DCO isn't turning green but that's the one thing we are waiting on.

tarilabs commented 5 months ago

This looks good @tarilabs - not sure why the DCO isn't turning green but that's the one thing we are waiting on.

thanks @vsoch I've bumped the commit message maybe it was missing a double empty line, not sure, but seems to be passing now 👍 🚀