Skip to content

[FC-0118] docs: add ADR for standardizing API documentation and schema coverage#38189

Open
Abdul-Muqadim-Arbisoft wants to merge 2 commits intoopenedx:docs/ADRs-axim_api_improvementsfrom
edly-io:docs/ADRs-axim_api_improvements
Open

[FC-0118] docs: add ADR for standardizing API documentation and schema coverage#38189
Abdul-Muqadim-Arbisoft wants to merge 2 commits intoopenedx:docs/ADRs-axim_api_improvementsfrom
edly-io:docs/ADRs-axim_api_improvements

Conversation

@Abdul-Muqadim-Arbisoft
Copy link
Contributor

Description

Currently, API documentation and schema coverage is inconsistent across Open edX services, with many views lacking OpenAPI decorators and machine-readable documentation. This ADR proposes standardizing on drf-spectacular with @extend_schema decorators across all endpoints to improve AI-tool discoverability, reduce duplicate endpoints, and provide a consistent developer experience for external integrations.

Issue: #38164

- Propose adoption of drf-spectacular across Open edX services
- Require @extend_schema decorators for all API endpoints
- Document request/response schemas, status codes, and error conditions
@Abdul-Muqadim-Arbisoft Abdul-Muqadim-Arbisoft changed the title docs: add ADR for standardizing API documentation and schema coverage [FC-0118] docs: add ADR for standardizing API documentation and schema coverage Mar 18, 2026
"""Create a new discussion topic."""
return Response({"detail": "Topic created"}, status=201)

Consequences
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently we use https://github.com/openedx/api-doc-tools/ as a shim over drf-yasg, which is currently being used to generate API docs in the platform. Another option here would be to update that tool to replace the underlying drf-yasg usage with drf-spectacular. This would mean that all the endpoints we have currently documented would not need new documentation or further updates. If that is not viable, then I think a consequence would be the deprecation and archival of api-doc-tools and drf-yasg and if that's the direction you want to move then you should document that here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for flagging this, you're right that the ADR doesn't address api-doc-tools

One concern with upgrading the shim to use drf-spectacular under the hood is that drf-yasg is largely unmaintained at this point and has notable limitations with OpenAPI 3.0 support, which is part of the motivation for moving to drf-spectacular in the first place. Also worth noting that even if we swap the internals, we'd still be committing to maintaining api-doc-tools as a wrapper indefinitely, it would need to keep up with drf-spectacular's API over time, which is ongoing effort with not a lot of upside once the migration is done.

That said, I want to make sure I'm not dismissing the upgrade path without properly investigating it. I'll do an R&D to check the feasibility of replacing drf-yasg inside api-doc-tools with drf-spectacular, and update the ADR based on findings. If it's viable and the maintenance burden is acceptable, that's clearly the lower-friction path. If not, I'll document the deprecation of api-doc-tools and drf-yasg explicitly as a consequence as you suggested.

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.

3 participants