-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Publish open api spec on AWX for community use #16221
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
base: devel
Are you sure you want to change the base?
Conversation
|
@tvo318 and @thedoubl3j FYI I opened a bug related to the schema while taking a look at this: #16222 |
| AWX OpenAPI Schema | ||
| =================== | ||
|
|
||
| This document describes the OpenAPI 3.0.3 specification for the AWX API (version v2). AWX is the open-source upstream project for Red Hat Ansible Automation Platform (formerly Ansible Tower). The schema can be accessed from https://s3.amazonaws.com/awx-public-ci-files/devel/schema.json. |
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.
@tvo318 I would advocate for using a sphinx extension that can render the OpenAPI spec in human readable form. I've been playing around with it and think sphinxcontrib-redoc is a pretty good option: https://sphinxcontrib-redoc.readthedocs.io/en/stable/
(We could use sphinxcontrib-openapi instead but the experience is not as nice imho.)
Here is an example from my fork: https://oranod-ansible.readthedocs.io/projects/awx/en/latest/open_api/explorer.html
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.
I love it. As long as we can fetch changes during a build, that would be easiest to maintain, I good with making it human-readable.
docs/docsite/rst/index.rst
Outdated
| contributor/index | ||
| contributor/DJANGO_REQUIREMENTS | ||
| contributor/API_REQUIREMENTS | ||
| contributor/openapi_link |
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 that I've been playing around with the docs, it makes a lot more sense to put this under developers instead. In my fork, I put the OpenAPI spec under the REST API docs like this: https://oranod-ansible.readthedocs.io/projects/awx/en/latest/open_api/index.html
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 thinking!
|
Oh, I also just noticed that the schema has this email address. Is this intended for community feedback? Maybe a pointer to the issues list in this repo would be better? |
The missing reference is already an issue in Jira that I’m actually assigned to. Let's keep this for transparency to the community. |
Co-authored-by: Don Naro <dnaro@redhat.com>
I'm not sure, let me check with that team. |
| message='pkg_resources is deprecated', | ||
| category=UserWarning, | ||
| module='sphinxcontrib.redoc', | ||
| ) |
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.
Warning filter uses wrong category for deprecation warnings
Low Severity
The warnings.filterwarnings call uses category=UserWarning to suppress pkg_resources deprecation warnings, but pkg_resources emits DeprecationWarning not UserWarning. This mismatch means the filter won't catch the intended warnings and they'll still appear in build output. The category parameter needs to be DeprecationWarning for the suppression to work as the comment indicates.
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.
During sphinx-build I see this:
/home/dnaro/git/awx/.tox/docs/lib/python3.14/site-packages/sphinxcontrib/redoc.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
|


SUMMARY
Publish link to open api spec on AWX for community use.
ISSUE TYPE
COMPONENT NAME
Note
Introduces OpenAPI (v3) documentation to the AWX docs and wires it into the build.
sphinxcontrib.redocinconf.pyand configuresredocto renderrst/open_api/schema.jsonatopen_api/explorerdocs/docsite/download-json.pyto fetchswagger.jsonand the OpenAPIschema.json; replaces old per-swagger script and updatestoxdocs command to run itrst/open_api/pages and links them fromindex.rstpubdateshort)requirements.inand regeneratedrequirements.txtwith ReDoc and depsWritten by Cursor Bugbot for commit 4632d60. This will update automatically on new commits. Configure here.