This fixes two problems with JSON pointer refs and known keywords:
If the ref resolved to a Keyword object with a schema value (eg,
#/items), unknown_schema! was called, which was only defined for
UnknownKeyword. I changed the name to parsed_schema and defined it
for all keywords, though it still feels brittle since it requires
keywords to pre-parse their values into schema objects.
If the ref resolved through a Keyword object with a schema value
(eg, #/items/not), fetch was called on the keyword's parsed
schema, which wasn't defined. I settled on a fetch method for
Keyword and Schema to find child objects by key/index. That way a
keyword with a schema value will delegate fetch to its parsed schema
object. UnknownKeyword also becomes less of a special case.
I also added a Schema type check after pointer resolution to help
people identify misdirected pointers.
This fixes two problems with JSON pointer refs and known keywords:
If the ref resolved to a
Keyword
object with a schema value (eg,#/items
),unknown_schema!
was called, which was only defined forUnknownKeyword
. I changed the name toparsed_schema
and defined it for all keywords, though it still feels brittle since it requires keywords to pre-parse their values into schema objects.If the ref resolved through a
Keyword
object with a schema value (eg,#/items/not
),fetch
was called on the keyword's parsed schema, which wasn't defined. I settled on afetch
method forKeyword
andSchema
to find child objects by key/index. That way a keyword with a schema value will delegatefetch
to its parsed schema object.UnknownKeyword
also becomes less of a special case.I also added a
Schema
type check after pointer resolution to help people identify misdirected pointers.Closes: https://github.com/davishmcclurg/json_schemer/issues/159