Skip to content

Commit

Permalink
Fix BaseModel construction for required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and RobertCraigie committed Jul 25, 2022
1 parent 4a31ae0 commit 0b5d822
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lithic/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def construct(cls: Type[ModelT], _fields_set: set[str] | None = None, **values:
key = name

if key in values:
if values[key] is None and not field.required:
if values[key] is None:
fields_values[name] = field.get_default()
else:
if not is_literal_type(field.type_) and (
Expand Down

0 comments on commit 0b5d822

Please sign in to comment.