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

way to validate while ignoring missing values #221

samuelcolvin opened this Issue Jul 3, 2018 · 0 comments


1 participant

samuelcolvin commented Jul 3, 2018

So if I have

def Foo(BaseModel):
  foo: int
  bar: str

Foo(foo=1) would raise a validation error as bar is missing, but Foo.ignore_missing(foo=1) would pass.

Perhaps this would be better achieved by modifying _process_values so it doesn't always raise validation errors but instead returns them and values.

samuelcolvin added a commit that referenced this issue Jul 4, 2018

samuelcolvin added a commit that referenced this issue Jul 5, 2018

add validate_model (#224)
* add validate_model, fix #221

* errors None from validate_model if ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment