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

more sophisticated pre-evaluation traversal is needed #33

Closed karenetheridge closed 3 years ago

karenetheridge commented 4 years ago

Currently, the pre-evaluation traversal of a schema (to identify embedded identifiers in $id and $anchor keywords, and in the future to identify alternative $schema values) is very naive and just walks the data structure, extracting all fields it finds. This is not good enough, as keywords embedded in non-schema nodes (e.g. under enum, const, default and examples keywords) will generate false positives, which at best creates bogus entries in the resource index and at worst can result in a non-schema conflicting with a real schema elsewhere (which will raise an exception) or even in the future cause an invalid metaschema or vocabulary to be applied to the schema.

We also need a more sophisticated traverser for identifying and extracting embedded $refs for bundling referenced definitions together with a schema (see #16)

See my conch notes circa mid-August for some hints as to how to implement this.

karenetheridge commented 3 years ago

This is done in a side branch; waiting for a few small things in order to release.

karenetheridge commented 3 years ago

This is done in release 0.017.