RFC: more rigid, but simpler schema validation #178
Labels
interoperability
Making JAMS play nice with other packages
schema
Issues pertaining to schema definitions
Milestone
TL;DR
What if we rewrote all namespace partial schemas as proper schemas, index them in the master schema, and then say each annotation has to validate as a
oneOf: [namespace1, namespace2, ...]
?More detail
We're using jsonschema in some pretty unsavory ways right now, and those ways make it harder to port jams validations into different implementations. Moreover, it makes it difficult to version the schema explicitly, which is something we really ought to do.
what would this look like?
We could specify loose annotation schemas and hard-code the namespace field to act as the indexer, so a
key_mode
annotation will only validate (and fast-fail) if the namespace string matches.We'd then use
$ref
s to link up all the namespaces we know about, and remove the dynamic loader / dispatch logic. This should make it easier to call out to other validation engines (as discussed here #170) and port to other languages.
What we lose is the ability to release custom schema with datasets that aren't explicitly coded in the master jams schema. (You could maybe monkey-patch that, but it would be less convenient.) I don't see this as a big loss, since nobody appears to be using this functionality anyway.
What do yall think?
The text was updated successfully, but these errors were encountered: