You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like an awkward behavior. Could you please provide a minimal reproducible example including the code of the complete pydantic model, the pydantic version you're using and all non-default configurations (conf.py and directive options)? This will help reproduce the bug.
Hi, I have the same problem. Here is an example and versions of code I'm using:
from pydantic import BaseModel, Field
from pydantic.config import ConfigDict
class Example(BaseModel):
"""
Pointing offset script parameters
"""
model_config = ConfigDict(title="example")
version: Annotated[
str,
Field(
pattern=r"^[a-zA-Z0-9_\.-]+$",
default="0.1.1",
title="My example failing class",
description="autodoc_pydantic does not deal with regex correctly",
),
]
When using this kind of types in models:
It looks like the generator does not properly escape the regex as needed:
The text was updated successfully, but these errors were encountered: