-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
Description
I was mucking about with fastapi and tried sending the json value false to a str field.
Imagine my surprise when "False" was saved in my database instead of getting a 4xx response.
Now, I might have done something wrong, though I've just copied/pasted the docs - which just use the default settings.
The data passed into pydantic really is a False
> request._json
{'text': False, 'completed': True}
See pydantic/pydantic#1130 as well.
I'm wondering if the default settings are pedantic is enough or if fastapi should ship with a StrictModel instead?