{"title":"Pydantic \u3067 JSON \u3092\u8aad\u307f\u8fbc\u3080\u6642\u306b\u578b\u5909\u63db\u3055\u308c\u308b","type":"rich","categories":["Python"],"version":"1.0","height":"190","provider_name":"Hatena Blog","image_url":null,"width":"100%","blog_title":"\u307f\u30fc\u306e\u307a\u30fc\u3058","published":"2023-12-17 00:35:41","description":"\u4f8b\u3048\u3070 dict[int, int] \u3092 JSON \u3067\u8a18\u8ff0\u3057\u3088\u3046\u3068\u3059\u308b\u3068\uff0c\u30ad\u30fc\u306f\u6587\u5b57\u5217\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\uff0cPydantic \u304c\u3046\u307e\u304f\u578b\u5909\u63db\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u6c17\u306b\u305b\u305a\u4f7f\u3048\u3066\u4fbf\u5229\u3067\u3059\uff0e % python --version Python 3.11.6 % pip freeze pydantic==2.5.2 test_pydantic.py import json import unittest from pydantic import BaseModel class A(BaseModel): str_dict: dict[str, int] int_dict: dict[int, int] c\u2026","provider_url":"https://hatena.blog","author_name":"atsuhiro-me","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpc.atsuhiro-me.net%2Fentry%2F2023%2F12%2F17%2F003541\" title=\"Pydantic \u3067 JSON \u3092\u8aad\u307f\u8fbc\u3080\u6642\u306b\u578b\u5909\u63db\u3055\u308c\u308b - \u307f\u30fc\u306e\u307a\u30fc\u3058\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://pc.atsuhiro-me.net/","author_url":"https://blog.hatena.ne.jp/atsuhiro-me/","url":"https://pc.atsuhiro-me.net/entry/2023/12/17/003541"}