Provide proper loose/strict values diff behavior
artem-zakharchenko opened this issue · 0 comments
artem-zakharchenko commented
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:
gavel-spec/features/expectations/body_json_example.feature
Lines 79 to 95 in 9f68503
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:
- There has been an invalid JSON example #39, which produced false positive upon validating this feature suit.
- When the JSON is valid, there is no error thrown in Gavel, which fails the feature tests.
- 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.