Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Use json-schema gem instead of json_schema #9

Merged
merged 2 commits into from
Nov 10, 2017

Conversation

ssteeg-mdsol
Copy link
Contributor

Inspired by #7 and in response to the json_schema gem not properly validating nested objects, this PR switches the json_schema gem with the json-schema gem.

We found this issue when there was an OpenAPI spec file with an invalid HTTP method type.

paths:
  /animals:
    fake-http-method:

Despite the spec defining the allowed values in /resources/swagger_meta_schema.json#L306-L343, those rules were not being enforced by the json_schema gem and the invalid spec was considered valid. Using the json-schema gem, validation was performed properly:

The property '#/paths//animals' contains additional properties ["fake-http-method"] outside of the schema when none are allowed in schema

Also, fixed some of the descriptions in valid_spec.yaml that were copy pasted.

@drewolson @jfeltesse-mdsol @jcarres-mdsol @ykitamura-mdsol

@drewolson
Copy link
Contributor

Thanks. I'll try to take a look at this later this week.

@ssteeg-mdsol
Copy link
Contributor Author

Gentle ping~ 😄

@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = "~> 2.0"

spec.add_dependency "addressable", "~> 2.3"
spec.add_dependency "json_schema", "~> 0.15.0"
spec.add_dependency "json-schema", "~> 2.8.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that dependency a bit too restrictive? IMHO ~> 2.8 is better.

@jfeltesse-mdsol
Copy link
Contributor

@drewolson do you have a rough idea on when you'll have time to have a look? We can always use our fork in the meantime but that's obviously not an ideal solution.

@drewolson
Copy link
Contributor

I plan on investigating this Friday.

@drewolson drewolson merged commit 4168c80 into braintree:master Nov 10, 2017
@ssteeg-mdsol
Copy link
Contributor Author

Much appreciated @drewolson!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants