Merge pull request #120 from gowthamparuchuru/main

corrected Strict Validation documentation
This commit is contained in:
Simon Prickett 2022-04-22 11:14:00 +01:00 committed by GitHub
commit 31fd071211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -465,15 +465,15 @@ try:
first_name="Andrew",
last_name="Brookins",
email="a@example.com",
join_date="2020-01-02", # <- A date as a string shouldn't work now!
age="38"
join_date="2020-01-02",
age="38" # <- Age as a string shouldn't work now!
)
except ValidationError as e:
print(e)
"""
pydantic.error_wrappers.ValidationError: 1 validation error for Customer
join_date
Value must be a datetime.date object (type=value_error)
age
Value is not a valid integer (type=type_error.integer)
"""
```