-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. Closes: #159
- Loading branch information
1 parent
f48c563
commit 52fb83f
Showing
4 changed files
with
98 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters