Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant