Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Design Guidelines: HTTP Status Code type should be Integer, not String #143

Closed
hdamker opened this issue Jan 31, 2023 · 6 comments · Fixed by #145
Closed

Design Guidelines: HTTP Status Code type should be Integer, not String #143

hdamker opened this issue Jan 31, 2023 · 6 comments · Fixed by #145

Comments

@hdamker
Copy link
Contributor

hdamker commented Jan 31, 2023

Currently the API Design Guidelines define HTTP Status Code as String within the "proposed json error structure":

{
   "status": "400",
   "code": "INVALID_ARGUMENT",
   "message": "A human readable description of what the event represent"
}

There is a discussion in QualityOnDemand (see here) which came to the conclusion that the type Integer for the HTTP Status Code would be the better solution:

It would be great if this issue could be addressed short-term in Commonatlities as it is currently blocking the PR Align error format with Commonalities guidelines which itself should be done before other PRs.


Further noticed, but not part of this issue:

  • The references to RFC 2616 and RFC 7231 in chapter 3.2 of the API Design Guidelines could be replaced by RFC 9110, as they are obsoleted by the newer one.
  • Chapters 3.2 (HTTP Response Codes), 6 (Error Responses) and 11.5 (Data Definitions) have overlapping content and are not consistent
@shilpa-padgaonkar
Copy link
Contributor

I agree. As stated in https://httpwg.org/specs/rfc9110.html#rfc.section.15 - status code of a response should be a three-digit integer code.
I would recommend the change as

{
"code": 400,
"status": "INVALID_ARGUMENT",
"message": "A human readable description of what the event represent"
}

If the colleagues currently involved in the discussion for aligning QoD with the Guidelines doc, already create a PR against the doc, it would help speed up this task as it can then be discussed and agreed in the next commonalities call.

@eric-murray
Copy link
Contributor

eric-murray commented Jan 31, 2023

Agree

@RubenBG7
Copy link
Contributor

RubenBG7 commented Feb 2, 2023

Agree, let me change the definition

@RubenBG7
Copy link
Contributor

RubenBG7 commented Feb 2, 2023

Issues 145 (API Guidelines) and 146 (CAMARA_common.json ModelError Property) with docs changes applied.

@hdamker
Copy link
Contributor Author

hdamker commented Feb 2, 2023

Issue is resolved with #145 and #146

@RubenBG7
Copy link
Contributor

RubenBG7 commented Feb 8, 2023

Changes added on #149 to delete string patter due to change to integer, and #150 fixed some bad words and format in github view

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants