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
3 changes: 2 additions & 1 deletion .github/workflows/reusable-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ jobs:
fail_ci_if_error: true
- name: Install spell checker
run: |
sudo apt install libenchant-2-dev
sudo apt-get update
sudo apt-get install -y libenchant-2-dev
pip install -r requirements/doc-spelling.txt
- name: Run docs spelling
run: |
Expand Down
3 changes: 3 additions & 0 deletions CHANGES/1624.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed the pydantic usage example to include the required
``model_config = ConfigDict(arbitrary_types_allowed=True)``
setting -- by :user:`veeceey`.
7 changes: 5 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,15 @@ convert bools into strings using own preferred translation protocol.

.. _yarl-pydantic-support:

The :class:`~yarl.URL` could be used as a field type in pydantic_ models seamlessly::
The :class:`~yarl.URL` could be used as a field type in pydantic_ models
by setting ``arbitrary_types_allowed`` in the model config::

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
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ manylinux
multi
nightlies
pre
pydantic
pytest
rc
reStructuredText
Expand Down
Loading