4 ms·
What about error representation? Most of the time I find that actually representing errors is the hard part of creating a REST api. You usually want some repre
by vinceve 10y ago
What about error representation? Most of the time I find that actually representing errors is the hard part of creating a REST api.
You usually want some representation of each field, plus maybe a generic one. I always have troubles with this. Is there a standard or a proper way to define/do this? I would be very interested.
- 3pt14159 10y agoIf you are returning multiple errors of different types, (403 for the forbidden change and 422 for the incorrectly set field) then you are supposed to role it up into a generic 400. Google JSON API for more information about the right way to represent multiple errors at a time.
- idbehold 10y agoThere's an RFC for that! https://tools.ietf.org/html/rfc7807 https://tools.ietf.org/html/rfc7807