🐛 Fix pydantic v2 basemodel config ignore extra

This commit is contained in:
xtaodada 2024-12-02 16:46:49 +08:00
parent 2982e1f1a1
commit 4c4d69a492
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -1,5 +1,4 @@
import pydantic import pydantic
pydantic.BaseModel.model_config["extra"] = "allow"
pydantic.BaseModel.model_config["coerce_numbers_to_str"] = True pydantic.BaseModel.model_config["coerce_numbers_to_str"] = True
pydantic.BaseModel.model_config["arbitrary_types_allowed"] = True pydantic.BaseModel.model_config["arbitrary_types_allowed"] = True