When I am parsing custom classes with the default JSON
BodyParser, if an exception is thrown during parsing - e.g. if my class has a
require() condition which wasn’t met - a 500 is returned for the request. I think this scenario should return a 400 Bad Request - if attempting to parse the input to my custom type threw.
How can I extend the json
BodyParser or create my own to achieve this?