typescript-rest
                                
                                 typescript-rest copied to clipboard
                                
                                    typescript-rest copied to clipboard
                            
                            
                            
                        How to respond with error and an error entity JSON inside response body
Question...
Is there a way to build an endpoint that responds with 400 Bad Request and the following inside of the request response body?
{
 "errors": [
    {"field": "customParam", "message": "It is wrong" }
  ]
}
PS Great library, nice work! 👍
You should be able to do it the standard express way:
    res.status(400).send({ errors: [{ fields: "param", message: "SO wrong!" }] })
HI, take a llok at this