Replies: 1 comment
-
|
This issue has been fixed in v0.25.7+ - the generator now automatically detects lookaround patterns and adds regex_engine="python-re" to ConfigDict, so please upgrade to resolve this. Thank you!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to generate a Pydantic v2 model and then import it. The OpenAPI spec includes some objects in the schema that have patterned fields with patterns that are unsupported by Pydantic v2. Here's an example of a field from a class generated from that spec
Then import fails when Pydantic tries to create the validator
Do I just need to strip out the pattern? Is there a command option that can do that? Should this be submitted as an issue, the fact the spec is converted even though some fields are invalid (according to Pydantic v2)?
Here's the command used to generate the models
datamodel-codegen --url https://docs.canopyservicing.com/openapi/645bb7f0ea9f151255ed1f70 --output model.py --output-model-type pydantic_v2.BaseModel --use-annotatedBeta Was this translation helpful? Give feedback.
All reactions