Raise a warning when request validation causes a response validation failure #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The request validator can raise a 400 error if the incoming request fails
the validation implied by the spec. If the spec does not allow a matching
400 response from this endpoint, that error will be lost and replaced with
a validation error for a bad response code. While we already log the relevant
information, this adds a warning to explicitly alert programmers that they
have erred with their API specification.
This was inspired by #49 and causes the following output from pytest if you write a test that hits this edge case:
Other test runners may not show the warning, but I think this is an improvement.
Note: The push pre-commit step segfaulted for me. The individual commit ones worked fine, so I think it's okay, but I wanted to flag this.