Skip to content

way to validate while ignoring missing values #221

@samuelcolvin

Description

@samuelcolvin

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions