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

replace traverse code with evaluation against metaschema #68

Open karenetheridge opened 2 years ago

karenetheridge commented 2 years ago

As the work in JSMDO has shown, a schema's traverse phase is very similar to the act of evaluating the schema against its metaschema -- the work we do at traverse time to identify embedded identifiers etc can be replaced by similar code that is triggered by evaluation callbacks on the properties keyword.

One interesting counter-example is if a document changes its dialect (embedded $schema keyword) midway -- at that point we cannot keep evaluating the schema against the same metaschema, as now the metaschema has changed. (!)