Closed arttuperala closed 1 year ago
Merging #301 (457384d) into master (8cd209a) will increase coverage by
0.0%
. The diff coverage is100.0%
.
@@ Coverage Diff @@
## master #301 +/- ##
======================================
Coverage 98.6% 98.6%
======================================
Files 9 9
Lines 528 531 +3
Branches 97 99 +2
======================================
+ Hits 521 524 +3
Misses 4 4
Partials 3 3
Impacted Files | Coverage Δ | |
---|---|---|
openapi_tester/validators.py | 100.0% <100.0%> (ø) |
Looks good! Thanks @arttuperala 👏
validate_unique_items()
validator had a known issue where it could not validatedict
objects in any way. Attempting to pass one would result in an immediateTypeError: unhashable type: 'dict'
.This merge request adds support for validating
dict
objects by serializing them to ordered JSON strings and doing the comparison with those. I imagine that this solution might not be flexible enough to handle every possibledict
but it should be better than not being able to handle anydict
. And since we are talking about data returned by an API, it's quite likely that the data passed to the validator will actually be JSON serializable.