Skip to content

progsmile/fast-api-pydantic-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bug description

hide_input_in_errors does not work for fast api responses. input field is present in both responses, however models configured to hide the error Check src/user.py for configuration

Reproduce steps

Init env

poetry shell
poetry install
python -m src

Sample #1

curl --request POST \
  --url http://localhost:8000/user_1 \
  --header 'Content-Type: application/json' \
  --data '{"name": "1"}'

Response

{"detail":[{"type":"missing","loc":["body","firstName"],"msg":"Field required","input":{"name":"1"},"url":"https://errors.pydantic.dev/2.1/v/missing"}]}

Sample #2

curl --request POST \
  --url http://localhost:8000/user_2 \
  --header 'Content-Type: application/json' \
  --data '{"name": "1"}'

Response

{"detail":[{"type":"missing","loc":["body","firstName"],"msg":"Field required","input":{"name":"1"},"url":"https://errors.pydantic.dev/2.1/v/missing"}]}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages