-
Notifications
You must be signed in to change notification settings - Fork 774
Description
While reading #148, the http.FileSystem section struck me as the wrong approach. “I'd like to validate this content against this JSON Schema” is easy to support generically, and keeping the schemas themselves outside of that tool allows you to use an existing version of the tool to validate new content against new schemas. If you compile the schemas in, you have to rebuild the tool to get access to the new schemas.
For an alternative approach, see the in-flight opencontainers/runtime-spec#490. This approach allows a generic JSON-Schema validator to use whichever schema you point it at. It would be nice to put the schemas up on www.opencontainers.org/schema/…, but even without that you can use the raw GitHub URLs. For oci-image-tool, you'd need a method to convert the detected/configured media type / version to a schema URL, but you already do that for http.FileSystem. The URLs would just get a bit longer, and if we start removing schemas you'd have to add logic to pin to the last image-spec version which carried a schema for your media type.
If this sounds like a reasonable approach, I can work up a PR.