2 ms·
I feel exactly the same. I also want to add that consumers with an appropriate framework can automatically generate a response body explaining where in the pay
by jonathanlydall 5y ago
I feel exactly the same.
I also want to add that consumers with an appropriate framework can automatically generate a response body explaining where in the payload that errors were encountered and what those errors are. This allows API consumers to understand what is going wrong far more easily that a 500 being returned.
ASP.NET for example can do exactly this with validation on incoming payloads.
If the payload is invalid, then either way there will be an error, but it's nice to be able to give more helpful errors.
- dolmen 5y agoInput validation errors should be reported using HTTP code 400.