-
Notifications
You must be signed in to change notification settings - Fork 69
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
base: main
Are you sure you want to change the base?
Conversation
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. |
5231ca8
to
ac082b1
Compare
tools/apidocgen.py
Outdated
from uaclient import data_types | ||
|
||
NO_ARGS = "- This endpoint takes no arguments." | ||
NO_EXCEPTIONS = "- No exceptions raised by this endpoint." |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good catch!
21f9600
to
fcaa40f
Compare
fcaa40f
to
1c6985b
Compare
1c6985b
to
5322989
Compare
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
Does this PR require extra reviews?