BezBartek / restdantic

MIT License
4 stars 0 forks source link

There is no easy way to skip validation on Pydantic models #6

Open dominikbak opened 1 year ago

dominikbak commented 1 year ago

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