Skip to content

Conversation

agatheblues
Copy link

@agatheblues agatheblues commented Aug 7, 2025

Hello 🌈 !

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. I only hit the validation error when using the assert_schema function in my tests.

The problem was that one of my schema had additionalProperties: false from 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+.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant