示例
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