Replies: 5 comments
-
i want to define error msg that shows in response body for every fields |
Beta Was this translation helpful? Give feedback.
-
@a372661369 This is a pydantic question, not a fastapi one. Check here for defining custom validators: https://pydantic-docs.helpmanual.io/#validators |
Beta Was this translation helpful? Give feedback.
-
@pmav99 thk |
Beta Was this translation helpful? Give feedback.
-
In addition to a pydantic question, you also need to figure out how to override the response for a fastapi |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help and discussion here guys! Here are the docs about how to override the default exception handlers: https://fastapi.tiangolo.com/tutorial/handling-errors/#override-the-default-exception-handlers |
Beta Was this translation helpful? Give feedback.
-
i want to raise another error, maybe myself defined. or does it supports define a error in BaseModel what i want shows?
Beta Was this translation helpful? Give feedback.
All reactions