autodoc_pydantic
autodoc_pydantic copied to clipboard
Pattern validators not properly escaped
When using this kind of types in models:
MyType = Annotated[str, Field(min_length=3, max_length=256, pattern=r"^[a-z0-9_]+$")]
It looks like the generator does not properly escape the regex as needed:
docstring of MyModel.some_field:1:Unknown target name: "a-z0-9".