Add test for casting AllOf with one schema having additionalProperties: false#681
Open
agatheblues wants to merge 1 commit intoopen-api-spex:masterfrom
Conversation
…s: false I had a bit of a hard time tracing back the cause of the cast validation error that I was having: "Failed to cast value as object. Value must be castable using `allOf` schemas listed." since the resulting response had the correct shape and the right properties. Adding a unit test covering this case can help developers finding out what's going on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hello 🌈 !
I had a bit of a hard time tracing back the cause of the cast validation error that I was having:
since the resulting response had the correct shape and the right properties. I only hit the validation error when using the
assert_schemafunction in my tests.The problem was that one of my schema had
additionalProperties: falsefrom back when we created the schema some years ago 👵I thought that adding a unit test covering this case can help developers finding out what's going on (it would have helped me at least, since I was looking at this test file to understand what was different between my code and the working examples).
For additional context: the validation error did not pop up for version 3.12.0, and only started to come up on 3.14+.