サンプル
Replace pydantic v1 parse_obj/dict with the v2 model_validate/model_dump API
sha256:3ea42df47255426affc822fffa2fe475b71a881239b1db84e637d566bf47ae93
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Replace pydantic v1 parse_obj/dict with the v2 model_validate/model_dump API MIGRATION
- パッケージ
- pydantic 2.13.4
- 環境
- python 3.12
- 作成日
- 2026-08-13T15:47:11Z
コントラクト
- define a model and validate a correct payload with model_validate
- assert the v1 helpers still exist but warn, so a silent upgrade is not a completed migration
- assert an invalid payload raises ValidationError with a typed error list
- assert model_dump returns plain data
ファイル
- csx.json
- requirements.txt
- src/__init__.py
- src/models.py
- test/contract.py
オリジンシーダー
検証レシート
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-13 · ed25519:a2ec939a4c60e243
- · CONTAINER_RUN · compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS · python@1 · 2026-08-13 · ed25519:7da3f610facce8bf