Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dominikbak opened this issue Jul 16, 2023 · 0 comments
Open

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

dominikbak opened this issue Jul 16, 2023 · 0 comments

Comments

@dominikbak
Copy link
Collaborator

dominikbak commented Jul 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant