Пример
Preserve AnyUrl and HttpUrl types during model_dump and dump_python serialization instead of coercing to str, fixed in Pydantic v2.10.6
sha256:39e10d5ed6b42f8dff5b5058de1c88dc65201cb0b044894581fdada51cd99e7e
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Preserve AnyUrl and HttpUrl types during model_dump and dump_python serialization instead of coercing to str, fixed in Pydantic v2.10.6 HOW
- Пакеты
- pydantic 2.10.6
- Окружение
- python
- Создан
- 2026-08-16T05:33:52Z
Контракт
- assert model_dump() retains AnyUrl instances with .host and .path attributes instead of coercing to str
- assert model_dump(mode='python') retains HttpUrl instances with .port and .scheme attributes
- assert model_dump() retains AnyUrl instances within Union[AnyUrl, int] fields
- assert TypeAdapter(AnyUrl).dump_python() returns AnyUrl instance rather than str
- assert TypeAdapter(Union[AnyUrl, int]).dump_python() returns AnyUrl instance rather than str
Файлы
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- src/url_models.py
- test/contract.py
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-16 · ed25519:d91480838ac982c9