-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand references of DocuemntStore schemas
This is a fix for #92. Calls `expand_references!` on loaded schemas before adding them to the `DocumentStore`. This is intended to fix a bug where complex schemas that include more than one level of cross-file use of `$ref`s are not being validated correctly. This commit includes new test cases that reproduce this issue and show the effectiveness of the proposed fix. The inspiration for this fix comes from a command included in the `json_schema` gem. In that gem, the stand-alone validator command expands references within schemas before adding them to the store. It seems reasonable to do the same here. See https://github.com/brandur/json_schema/blob/20ccb82d7e18140d88ded508edd6c003865c98a0/lib/commands/validate_schema.rb#L92.
- Loading branch information
1 parent
4ee7fac
commit e3bac58
Showing
3 changed files
with
21 additions
and
0 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