-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add x-ai-description to schema #16186
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
Conversation
| 'ansible_base.resource_registry', | ||
| 'ansible_base.rbac', | ||
| 'ansible_base.feature_flags', | ||
| 'ansible_base.api_documentation', |
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.
Bug: Missing django-ansible-base extra for api_documentation
The 'ansible_base.api_documentation' app is added to INSTALLED_APPS, but the corresponding extra is not included in the django-ansible-base package specification in requirements/requirements_git.txt. This will cause Django to fail with an import error when trying to load the application. The api-documentation (or api_documentation) extra must be added to the django-ansible-base requirements specification.
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.
doesn't seem relevant
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 think you could, but @Jaapis already added the drf-spectacular dependency, which is what that would indirectly get you
1e4b61e to
2a92142
Compare
|
@pb82 some problematic entries I noticed bad parsing on "activity_stream" and other endpoints with a "_"e.g. generated description is "List all stream for an ad_hoc_command". It should say "List all activity stream.." instead for whatever reason the description will drop the part that comes before "_" another example, some root APIs/api/v2/bulk these are just root entry points to futher endpoints, but the description says something along the lines of "Retrieve single analytic" which is not correct action related endpoints like cancel, relaunch, health_check, copy, delete, approve, denythe action oriented endpoints don't have good descriptions out of the box E.g. I fixed up some of the POSTs for launch and relaunch, but not the GET descriptions, e.g. "Retrieve single launch for a system_job_template" api/v2/me"List all me" lol other descriptions that are wrong
|
Adding ansible_base.api_documentation to the INSTALL_APPS extends the schema to include an AI friendly description to each endpoint Signed-off-by: Seth Foster <[email protected]>
Signed-off-by: Seth Foster <[email protected]>
|
@fosterseth here is the list of endpoints and their generated description: https://gist.github.com/pb82/cebb9f540383630a0fc85cefc8f46c2c |
|
And here is the special requirement for credentials create: https://gist.github.com/pb82/cebb9f540383630a0fc85cefc8f46c2c#file-gistfile1-txt-L271 |
Signed-off-by: Seth Foster <[email protected]>
Signed-off-by: Seth Foster <[email protected]>
|



SUMMARY
Adding ansible_base.api_documentation to the INSTALL_APPS extends the schema to include an AI friendly description to each endpoint
get full list if endpoints, action, and description here https://gist.github.com/fosterseth/99d71c20ca1ddeb042ef7d179d3e5fc1
e.g.
ISSUE TYPE
COMPONENT NAME
Note
Augments API schema with AI-friendly descriptions and resource purpose metadata across endpoints and enables schema generation via ansible_base.api_documentation.
x-ai-descriptionviaextend_schema_if_availableto numerous API endpoints (GET/POST/OPTIONS), including analytics, bulk, debug, inventory, jobs, webhooks, etc.resource_purposeon view classes to describe endpoint intent.ansible_base.api_documentationtoINSTALLED_APPSto extend OpenAPI generation.skip_ai_descriptionfor disallowed GET mixin; include AI descriptions on proxy views.get()inGenericCancelView(no behavioral change) and sprinkle small doc-related decorators across many views.Written by Cursor Bugbot for commit 991fecb. This will update automatically on new commits. Configure here.