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

prohibit $refs to non-schemas #51

Closed karenetheridge closed 8 months ago

karenetheridge commented 2 years ago

This is an "optional" item in the spec but we can do it with a little more wizardry.

karenetheridge commented 2 years ago

This is probably not going to happen, since we now rely on $refs to "non-schemas" in OpenAPI documents.

This isn't true since we can override the management of references, as well as schema resources, in JSMDO's traverse sub.

in JSM::Traverse:

in JSM::Document constructor:

JSMDO::traverse:

karenetheridge commented 2 years ago

Since there is a performance cost (at traverse time) to performing this, this should be controlled by a constructor config value, defaulting to off (probably - because the specification is ambivalent about whether this is allowed).

karenetheridge commented 8 months ago

This is now done, at runtime when evaluating the $ref keyword (and those similar to it), in version 0.575.