What JSON schema should our API responses follow in error scenarios? #793
-
Seeking a decision, or clarity if such a decision already exists. I'm seeing some inconsistency in the API response schemas for error scenarios, and I'd like to know what the expected format is for API error responses so that I can open tickets when I notice APIs that do not conform. Sometimes I see: ["Error message"] Other times: {"detail":"Error message"} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I have a slight preference for returning an object instead of an array, because it allows us to add other data to the error response if necessary. If we use an object, I'd like to ensure we always use the same key. The key |
Beta Was this translation helpful? Give feedback.
-
We don't have this figured out yet, we have an issue open for it, #560. We're mostly using DRF's standard errors, see: https://www.django-rest-framework.org/api-guide/exceptions/. |
Beta Was this translation helpful? Give feedback.
We don't have this figured out yet, we have an issue open for it, #560. We're mostly using DRF's standard errors, see: https://www.django-rest-framework.org/api-guide/exceptions/.