Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alignment with API design guidelines #97

Closed
jlurien opened this issue Jan 19, 2023 · 2 comments
Closed

Alignment with API design guidelines #97

jlurien opened this issue Jan 19, 2023 · 2 comments

Comments

@jlurien
Copy link
Collaborator

jlurien commented Jan 19, 2023

Some weeks ago, a set of API design guidelines have been approved in commonalities.

Regarding terminolgy and style:

  • Reduce telco-specific terminology in API definitions.
    • This is treated in issue #90.
  • URI paths in lowercase and separated-by-hyphens.
    • Our paths are single word and already in lowercase
  • OperationIds are defined in lowerCamelCase.
    • We are already compliant
  • Objects are defined in CamelCase inside properties field. This affects declarations within definitions that are $ref in other parts.
    • We are already compliant
  • API input and output business data will follow the snake_case notation.
    • We are NOT compliant. This affects property names.

Errors must include:

  • A field status, which can be identified in the response as a standard code from list of Hypertext Transfer Protocol (HTTP) response status codes.
    • We have to add it to our model.
  • A unique error code, which can be identified and traced for more details. It must be human readable; therefore, it must not be a numeric code. In turn, to achieve a better location of the error, you can reference the value or field that is causing it, and include it in the message.
    • We should review our current codes and probably define new codes for expected logical errors.
  • A detailed description of message.
    • We are already compliant.

Proposed actions

  • Most of changes apply to current property names, as they must be formattted in snake_case. This can be addressed together with issue #90 in a new PR, when new terms are agreed.

  • We have to adapt errors, adding status, and at a same time we could enhance current documentation and examples. This can be done in separate PR.

jlurien added a commit to jlurien/QualityOnDemand that referenced this issue Jan 25, 2023
As discussed in issue [camaraproject#97](camaraproject#97), we have to align current error model and examples to the guidelines:

- Add new `status` property
- Created new `Generic500` response and $ref all previous instances
@hdamker
Copy link
Collaborator

hdamker commented Apr 19, 2023

Suppose this issue is done:

  • Most of changes apply to current property names, as they must be formattted in snake_case. This can be addressed together with issue #90 in a new PR, when new terms are agreed.

The final decision in Commonalities was camelCase for property names, which we will continue to use. Also the new terms are applied (with #129)

  • We have to adapt errors, adding status, and at a same time we could enhance current documentation and examples. This can be done in separate PR.

Done with #104

@hdamker
Copy link
Collaborator

hdamker commented Apr 24, 2023

All done.

@hdamker hdamker closed this as completed Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants