Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Return error response for invalid JSON payloads #334
I didn't inspect thoroughly so this is a bit of a lazy question, but wouldn't it be more in line with the validation error triggering a 422 if the parser aborted with 400 rather than raising an exception for the user to catch?
I find it a bit dodgy that we raise an exception that will trigger a 500 out of the box. Even with a major release and a warning.
I can live with that change. I'll just need to add a handler as you suggest, but is there a reason not to return a 400 error directly? The message could be personalized with a parser attribute if that's a concern. And the formatting can be done by catching the