-
-
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.
WIP: Use json_schema instead of json-schema
The problem * `json_matchers` cannot easily be used concurrently with Heroku's JSON API tools, i.e. `prmd` and `committee`, because `json_matchers` makes different assumptions about the structure of the user's schemata. An example of an incompatibility can be found in #25: `json_matchers` breaks when the `id` property is present within a schema, but the Heroku tools require the presence of the `id` property ([reference](https://github.com/interagent/prmd/blob/master/docs/schemata.md#meta-data)). This is happening because the libraries used to dereference JSON pointers behave differently. `json-schema`, the library we're currently using, appears to conform less strictly to the JSON Schema specification than the library the Heroku tools use, `json_schema`. The solution * One solution to this problem is to update `json_matchers` to use the same approach to validating schemata as the Heroku tools. This will require the following changes: 1. Use `json_schema` instead of `json-schema` to validate schemata 2. Update documentation to instruct readers to follow Heroku's guidelines for structuring schemata: https://github.com/interagent/prmd/blob/master/docs/schemata.md * In this commit I've replaced `json-schema` with `json_schema` and updated the schemata fixtures in the specs. Per [this json_schema issue](brandur/json_schema#22), in order to dereference JSON pointers referencing schemata in other files we need to access the gem's DocumentStore API directly. This is done in `Matcher#add_schemata_to_document_store`.
- Loading branch information
1 parent
48e7620
commit d4d4872
Showing
3 changed files
with
93 additions
and
13 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