karenetheridge / JSON-Schema-Modern

Validate data against a schema using a JSON Schema
https://metacpan.org/release/JSON-Schema-Modern/
Other
11 stars 1 forks source link

vocabulary extension: "isa" #18

Open karenetheridge opened 4 years ago

karenetheridge commented 4 years ago

As a new custom $vocabulary extension, it would be useful to have the keyword isa, which would check that the indicated instance data is blessed into the indicated class. This isn't compatible with JSON, but JSON Schema is useful in validating other data as well. It can also help facilitate translation back and forth between JSON Schema and Type::Tiny constructs, or embedding a JSON Schema into a Test::Deep#cmp_deeply check.

karenetheridge commented 3 years ago

see https://gregsdennis.github.io/json-everything/usage/schema/vocabs.html for more discussion on custom vocabularies.