karenetheridge / JSON-Schema-Modern

Validate data against a schema using a JSON Schema
https://metacpan.org/release/JSON-Schema-Modern/
Other
10 stars 1 forks source link

provide a bundled schema containing all metaschemas for a draft #62

Open karenetheridge opened 2 years ago

karenetheridge commented 2 years ago

This should make evaluation of a large document against its schema much faster.

We need to do this right in JSM (i.e. for everyone, all the time) because of circularity issues. therefore, the update-schemas script should do the bundling for us, and we can update CACHED_METASCHEMAS to point all URIs to the same bundle file.

karenetheridge commented 2 years ago

This can't happen until the spec is changed to allow the $vocabulary keyword to appear at a non-document root.

karenetheridge commented 2 years ago

I did this in a side branch and it seems to be slower, so I'm probably not going to release this.

karenetheridge commented 2 years ago

I should try again - instead of simply bundling the subschemas in $defs and continuing to $ref to them as normal, I can inline the schemas directly in the main allOf. This should be substantially better, since the ref resolution -> loading the new schema from the resource index -> evaluating at the new location is the time-consuming bit.