BaseModel (Pydantic)
Models are simply classes which inherit from BaseModel and define fields as annotated attributes.
model_fields
Metadata about the fields defined on the model, mapping of field names to FieldInfo.
This replaces Model.__fields__ from Pydantic V1.
model_validate_json
JSONデータ(文字列やbytes)から作る
model_dump
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
mode="python"(または"json")
v1がto_dict?
model_dump_jsonもある
self.__pydantic_serializer__.to_json().decode()