karenetheridge / JSON-Schema-Modern

Validate data against a schema using a JSON Schema

Home Page:https://metacpan.org/release/JSON-Schema-Modern/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

provide a bundled schema containing all metaschemas for a draft

karenetheridge opened this issue · comments

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.

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

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

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.