Closed XenoMonk closed 6 months ago
@XenoMonk thanks for pointing this out!
This is a known bug (#493). #499 has a fix for this and if I run your MCVE on that branch, there are no validation errors. For now, you'll have to downgrade to 2.14.0 since the bug was introduced in 2.14.1.
I agree that the MCVE is solved by downgrading to 2.14.0. But i am still getting similar errors in my production code. I am trying to make a new MCVE showing these in 2.14.0.
I agree that the MCVE is solved by downgrading to 2.14.0. But i am still getting similar errors in my production code. I am trying to make a new MCVE showing these in 2.14.0.
@XenoMonk the fix has been released as part of 2.15.0
. It'd be great if you could test it out with that and see if you're still facing any issues.
2.15.0 Seems to solve all the issues i have encountered. Thank you for your quick replies.
Description
I have attempted to make this bug report once from another account: https://github.com/litestar-org/polyfactory/issues/506 But it is not visible to any other users (or when logged out)
I am attempting to use nested annotations with pydantic FieldInfo on each level.
I have seen https://github.com/litestar-org/polyfactory/issues/434 and for a moment i thought simply updating polyfactory would solve my problem, but alas.
From what i can see these nested annotations are working correctly in pydantic and seems to be the expectation for more complex annotations, such that FieldInfo is applied to the correct "level" of the annotation.
The a and b attributes produce two different errors that seem related.
URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
No response
Logs
Release Version
Python: 3.10 Pydantic: 2.6.1 Polyfactory: 2.14.1
Platform