Pydantic validates model data on __init__
One way to skip validation is to use model_construct instead of __init__, but it does not support recursively constructing models from dicts so it is not suitable for our needs
The other idea is to split our Pydantic models into ReadModel and CreateModel and overwrite all fields on ReadModel with SkipValidation or look into how to overwrite schema that is going to be validated
Pydantic validates model data on
__init__
One way to skip validation is to usemodel_construct
instead of__init__
, but it does not support recursively constructing models from dicts so it is not suitable for our needs The other idea is to split our Pydantic models intoReadModel
andCreateModel
and overwrite all fields on ReadModel withSkipValidation
or look into how to overwrite schema that is going to be validated