-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
docs(api): update api description #13429
Conversation
Move the API description string to a separate variable to improve code readability. Add content to the (Open)API description summarized from general sections of the REST API documentation.
Weblate's REST API is based on [Django REST framework](https://www.django-rest-framework.org). | ||
You can interact with it on the `/api/` URL path by using the [Weblate Client]({get_doc_url(page='wlc')}) or any third-party REST client of your choice. | ||
|
||
## Authentication |
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.
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.
The OpenAPI spec allows to specify descriptions for the Security Scheme Object
, so it should be possible to move information from the Authentication
section in api_description
to this other area of code.
I thought of moving this info in a separate PR. Do you prefer to do it in this one?
requests per day. On the other hand, authenticated requests are rate limited | ||
to 5000 requests per hour by default. | ||
|
||
## API rate limiting |
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.
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.
Good remark. I have moved their description to the respective Python module.
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.
Any thoughts on comments I've posted before? I'm still not sure what is the best approach on documenting these.
Move information about the HTTP response headers related to rate limit to variables representing those headers in the docs.py module.
for more information, see https://pre-commit.ci
This will need similar wrapping as introduced in #13546. Still, I'm not convinced that the description is the best place where to describe authentication and rate limiting. |
The authorization is mostly covered by the standard features since 22b6a05, so let's close this one as most of its content has been incorporated elsewhere. |
Proposed changes
Checklist
Other information
The rationale behind this change is to help the OpenAPI document stand on its own.
Relates to #12584