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 thoughtbot#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