Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When you configure `JsonMatchers` to `record_errors`, it will result in all matchers returning as valid. The matcher was written around the idea that `.validate!` will raise an error if the JSON does not match the schema. However when you have `record_errors` set to `true`, things fall apart. First, `json_schema` will catch all errors and collect them in an array for error reporting. Next, `validate!` will always return `true` since it's written to assume that it should raise. In order to handle this scenario, I switched the matcher to use `fully_validate`, which allows for inspection of the errors. The use-case that brought this up for me was the desire to have better error reporting for when you use `allOf`. The default error message from `json_schema` is pretty useless because it doesn't give you any of the errors from the sub-schemas.
- Loading branch information