Hi guys, i’m working on an HTTP library specifically designed to be used with JSON API and i’m trying to figure out the expected behavior in case of invalid json api request.
Can i return a 400 Bad Request or there is a better solution?
Thanks
Did you read http://jsonapi.org/format/#errors ?
http://jsonapi.org/format/#content-negotiation
Also check out content negotiation and the errors sections at the end of various sections. You’ll get a 4XX error, but the code might tell you quite a bit about what you did wrong.
** A 5XX is also possible, but less of a concern because it wouldn’t be your fault if it went wrong.