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

feat: @Maturity annotation for endpoints #17701

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

jbee
Copy link
Contributor

@jbee jbee commented Jun 4, 2024

Summary

A new annotation that can be used in controllers to indicate the maturity of endpoints (methods) and/or individual endpoint parameters.

This is a first step for a long term goal for better documentation and the ability for the dev team to classify the API so that it is clear what conditions apply for users of the APIs.

For now the annotation is picked up by OpenAPI and rendered into the document as x-maturity. Such x- properties can be added to OpenAPI freely for additional information. It does not have any effect unless a tool specifically supports such additional properties.

Besides OpenAPI the maturity information might prove useful in other contexts.

@jbee jbee self-assigned this Jun 4, 2024
Copy link
Contributor

@maikelarabori maikelarabori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice initiative @jbee 👍
I just left some comments. Have a look if they make any sense.

Cheers

@david-mackessy
Copy link
Contributor

Nice initiative Jan. I like the idea of bringing more clarity/intention to the APIs 👍
Do you think that the enum comments would be enough to circulate these changes with the wider community?

Copy link

sonarcloud bot commented Jun 20, 2024

@jbee jbee marked this pull request as ready for review June 20, 2024 11:00
@amcgee
Copy link
Member

amcgee commented Jun 20, 2024

This is a good initiative. I think EXPERIMENTAL, STABLE, and DEPRECATED could be a simple, easy-to-understand, and useful set of initial maturity states.

flowchart LR
   EXPERIMENTAL --> removed
   EXPERIMENTAL --> STABLE
   STABLE --> DEPRECATED
   DEPRECATED --> removed
Loading

@jbee
Copy link
Contributor Author

jbee commented Jun 20, 2024

@amcgee deprecated is a individual flag that already exists in form of @Deprecated and the OpenAPI standard and the annotations we have informed by it. We should discuss in what way we want to merge this information when presented to the user and if we want a DEPRECARED maturity classification value that is implied once something is deprecated or if the maturity stays STABLE.

@jbee jbee merged commit e0924c5 into dhis2:master Jun 20, 2024
15 checks passed
enum Classification {
/**
* The API is stable and rarely subject to change. Change management occurs. Once an API is
* declared stable it does not change to another classification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text may be a bit misleading to some. It might not technically move to another Classification value but it could still move to Deprecated. This needs to be clear, whether that's in the code or the external publication or both. No harm mentioning it here I think.

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

Successfully merging this pull request may close these issues.

8 participants