Add a new catalog field matching versions based in an expression #3460
Labels
enhancement:build-server
Propose something new for the SchemaStore web site or build server. (auto-generated by issue forms)
Description of the feature / enhancement.
Context
Comes from #2440 (comment)_
The need to use different JSON Schema files based on a field or a combination of them is a common use case. For example, AsyncAPI documents have an
asyncapi
field containing the version of the spec in use by that particular document, I.e.3.0.0
. Each AsyncAPI major version requires a different JSON Schema file for validating documents.The current API for the Schema Store catalog only supports matching files with their corresponding JSON Schema docs based on the filename (
fileMatch
).Description
Add a new field that allows them to match files with their JSON Schema documents based on their content. For instance, following the example above, the
asyncapi
field in an AsyncAPI spec file.Additionally, to officialize the usage of the
versions
field found in some catalog entries as a map of version to JSON Schema document. In fact, I would suggest introducing a new field, not calledversions
butschemas
. This name fits better with it's purpose, which is basically to create aliases of JSON Schema document alternatives.The following is just a vague suggestion for implementing this feature request. Not written in stone, just for discussion sake:
Where:
schemas
field contains all possible JSON Schema documents identified by a name, id, or alias, the version in this case.Additionally, implementers such as VSCode, Taplo's TOML extension, and Red Hat's YAML extension will need to modify their implementations so they can apply those JMESPath expressions in order to match a particular schema.
Are you making a PR for this?
Yes, I will create a PR.
The text was updated successfully, but these errors were encountered: