equinor / equinor/api-strategy
[PROPOSAL] Add a section on a formalize error details in HTTP response (following RFC7807)
- Dominant language
- No language data
- Stars
- 95
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
### Problem:
When error happens in API processing developer need to return a code to the user and also some additional information, if possible.
Initially, [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) has been introduced with the idea to standardize the response for the error reporting from server to client (json and predefined fields, that can be extended).
Before the [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) started to be wide-spread, Zalando open-sourced their Java library [Problem](https://github.com/zalando/problem) that implemented this standard and supporting classes -- and this was quite popular and adopted quickly.
Nowadays, adoption of the [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) is a common practice (for example, in Java world: Spring framework implements it via [ProblemDetail](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/ProblemDetail.html) class which can be used as response on controllers).
### Proposal:
Could be a good idea to reference to the [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) somewhere in the [Equinor REST guideline](https://github.com/equinor/api-strategy/blob/master/docs/rest_guidelines.md).
Contributor guide
Assessment
This issue has not been assessed yet.