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

dev: tool to generate api endpoint documentation #3085

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

orndorffgrant
Copy link
Collaborator

@orndorffgrant orndorffgrant commented Apr 25, 2024

Why is this needed?

Our api docs are growing, and keeping them up-to-date and consistently styled is becoming tedious. This automates a lot of the work of creating the endpoint documentation by putting the docstrings as metadata with the code itself.

@lucasmoura @dheyay LMK what you think before I apply this strategy to the other existing endpoints.

Test Steps

Try out the new script (hopefully the docstring at the top of the file is sufficient to start playing with it)

Checklist

  • I have updated or added any unit tests accordingly
  • I have updated or added any integration tests accordingly
  • Changes here need to be documented, and this was done in:

Does this PR require extra reviews?

  • Yes
  • No

Copy link

Jira: This PR is not related to a Jira item. (The PR title does not include a SC-#### reference)

GitHub Issues: No GitHub issues are fixed by this PR. (No commits have Fixes: #### references)

Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references)

Documentation: The changes in this PR do not require documentation changes.

👍 this comment to confirm that this is correct.

from uaclient import data_types

NO_ARGS = "- This endpoint takes no arguments."
NO_EXCEPTIONS = "- No exceptions raised by this endpoint."
Copy link
Member

Choose a reason for hiding this comment

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

now may be the time to fix this kinda incorrect information
this is more like "no PARTICULAR exception expected to be raised here"

because see - all endpoints may spit UbuntuProErrors if things go wrong?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes good catch!

@orndorffgrant orndorffgrant changed the base branch from next-v33 to main June 6, 2024 20:38
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.

None yet

3 participants