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

support for setting/changing draft specification version from the "$schema" keyword #45

Closed karenetheridge closed 2 years ago

karenetheridge commented 3 years ago

The latest specification allows for $schema to appear anywhere a "schema resource" begins, which iff the "$id" keyword appears. In theory (even before supporting custom dialects) we should be able to switch between specification versions by encountering the "$schema" keyword whose value references one of the other draft specification URIs.

This is a necessary prerequisite for any sort of $vocabulary support (the document described by the URI needs to be loaded and parsed).

karenetheridge commented 3 years ago

This requires refactoring how we set up a schema document for traversal and evaluation -- we cannot instantiate vocabulary objects with $js->specification_version as today, as we will have already started traversal by the time we encounter the "$schema" keyword.

FOR NOW:

LATER, when we support different dialects (and hence different vocabularies):

karenetheridge commented 2 years ago

This is now done, as of release 0.518.