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

Provide proper loose/strict values diff behavior #40

Open
artem-zakharchenko opened this issue May 15, 2019 · 0 comments
Open

Provide proper loose/strict values diff behavior #40

artem-zakharchenko opened this issue May 15, 2019 · 0 comments

Comments

@artem-zakharchenko
Copy link
Contributor

There is a feature description that says Gavel should return a validation error upon validating an array that misses certain values opposed to expected array:

Scenario: Array member is missing in real JSON body
When real HTTP body is following:
"""
{
"object": {
"a": "bau bau",
"c": "boo boo",
"e": "mrau mrau"
},
"array": [
1
],
"string": "Foo bar"
}
"""
Then Gavel will set some error for "body"
And Request or Response is NOT valid

It appears this hasn't been working properly in the current version of Gavel, and thus this behavior is removed for now.

However, we must bring it back once it's properly supported in Gavel.

Background

The reason this feature never worked in gavel is:

  1. There has been an invalid JSON example Provides valid JSON for "body_json_example" feature #39, which produced false positive upon validating this feature suit.
  2. When the JSON is valid, there is no error thrown in Gavel, which fails the feature tests.
  3. The validation error is not thrown because the JsonSchema created from the expected JSON has valuesScript: false, which means it allows more or less values between given and expected JSON.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant