-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
after_property_validation causes corruption #196
Comments
I was able to do what I needed to do with annotations after validate but it is a little bit clunky. It serves my purpose in fixing a production bug but I wouldn't want to submit it as a PR. |
Hi @womblep—thanks for opening this. It looks like the behavior here was mistakenly changed in 2.0.0: aaafab1 |
@davishmcclurg I am not sure what correct behavior would be in the general sense. |
Agree |
I have an issue with using oneOf and after_property_validation.
after_property_validation is run after each property. In the case where there is a oneOf and subschemas with the same property name but a different format, the value in the data is replaced by the first format and therefore is corrupted for the next schema.
The data is being changed globally rather than discarded once the oneOf doesnt match that schema.
A contrived example is below:
This will fail when the rfc822 format is hit because the data is already converted to a Date.
Is that expected behavior? I expected that the values were sent into the subschema (and converted) but then discarded when it didn't match the oneOf subschema so it came as a bit of a surprise.
I think there may need to be a need for an after_schema_validation to cover scenarios like this. I think I will be able to put together something based on the annotations.
The text was updated successfully, but these errors were encountered: