corrected Strict Validation documentation
This commit is contained in:
parent
308b6c5b1c
commit
627b976db1
1 changed files with 4 additions and 4 deletions
|
@ -463,15 +463,15 @@ try:
|
||||||
first_name="Andrew",
|
first_name="Andrew",
|
||||||
last_name="Brookins",
|
last_name="Brookins",
|
||||||
email="a@example.com",
|
email="a@example.com",
|
||||||
join_date="2020-01-02", # <- A date as a string shouldn't work now!
|
join_date="2020-01-02",
|
||||||
age="38"
|
age="38" # <- Age as a string shouldn't work now!
|
||||||
)
|
)
|
||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
print(e)
|
print(e)
|
||||||
"""
|
"""
|
||||||
pydantic.error_wrappers.ValidationError: 1 validation error for Customer
|
pydantic.error_wrappers.ValidationError: 1 validation error for Customer
|
||||||
join_date
|
age
|
||||||
Value must be a datetime.date object (type=value_error)
|
Value is not a valid integer (type=type_error.integer)
|
||||||
"""
|
"""
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue