1

When sending wrong parameters, how can I customise the "422 Unprocessable Entity" error message to receive, instead of:

{"detail": [
{
"loc": [
. . . . . .
],
"msg": "field required",
"type": "value_error.missing"
}
]}

something more simple like this:

{"status": "failed", "error": "value_error.missing"}
Chris
  • 18,724
  • 6
  • 46
  • 80
Val
  • 75
  • 8
  • 1
    Related answers can be found [here](https://stackoverflow.com/a/71682274/17865804) and [here](https://stackoverflow.com/a/72833284/17865804). – Chris Feb 10 '23 at 15:23
  • 1
    I tested the first link and it's fine, is what I wanted. But all links are useful to me. Thank you so much! – Val Feb 10 '23 at 16:06

0 Answers0