-
-
Notifications
You must be signed in to change notification settings - Fork 233
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hi there!
I wonder how to change the default HTTP Status Code from 422 ( from here ) to smth custom ( in our case, it's 400 ).
With the current capabilities, I can customize almost everything in the default validation error by overriding huma.NewError function and get what I need:
HTTP/1.1 422 Unprocessable Entity
Connection: close
Content-Type: application/problem+json
{
"type": "bad-request/validation",
"title": "Bad Request",
"status": 400,
"detail": "Validation failed",
"errors": [
{
"message": "required header parameter is missing",
"location": "header.X-Custom-Header",
"value": ""
}
]
}However, I couldn't find a way to customize the HTTP Status Code for this case.
Could you please help me understand whether it's possible? If not, what do you think about implementing it? Does it make any sense?
Thank you.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working