Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1624.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated Pydantic example to include ``arbitrary_types_allowed=True`` in ``model_config`` -- by :user:`wuzhrun`.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ convert bools into strings using own preferred translation protocol.

The :class:`~yarl.URL` could be used as a field type in pydantic_ models seamlessly::

from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from yarl import URL

class Model(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)
url: URL


Expand Down
Loading