Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use json_schema instead of json-schema #31

Merged
merged 1 commit into from
Apr 13, 2018

Commits on Apr 13, 2018

  1. 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#build_and_populate_document_store`.
    Laila Winner authored and seanpdoyle committed Apr 13, 2018
    Configuration menu
    Copy the full SHA
    e8b3cc2 View commit details
    Browse the repository at this point in the history