Skip to content

fix: correct the SDK-facing schema for the transcript check and deprecated addresses - #39270

Open
Faraz32123 wants to merge 2 commits into
masterfrom
fix/youtube-transcript-check-schema
Open

Faraz32123 wants to merge 2 commits into
masterfrom
fix/youtube-transcript-check-schema

Conversation

@Faraz32123

@Faraz32123 Faraz32123 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Two schema fixes that show up in the generated SDK: edly-io/openedx-platform-sdk#6, generated from the current schema, types the transcript check as a list and adds *_legacy and old-address functions for deprecated endpoints.

The YouTube transcript check is documented as returning a list. GET /api/authoring/v1/courses/{course_key}/youtube_transcript_checks/ was routed to the viewset's list action, so drf-spectacular described its 200 response as an array. It returns one report, so generated clients failed to parse it. It is now routed to retrieve. The address, URL name and behaviour are unchanged; the operationId becomes v1_courses_youtube_transcript_checks_retrieve.

Deprecated addresses are still tagged for the SDK. A legacy address kept for its deprecation window shares its view with the replacement, so it inherits the openedx-platform-sdk tag, and the SDK generates functions for it (*_legacy, the old /api/contentstore/... and slashless enrollment addresses). A new post-processing hook, openedx.core.apidocs.untag_deprecated_operations, drops that tag from every operation marked deprecated: true. It is registered last in the CMS and LMS hook lists, after the hooks that mark operations deprecated, so it covers future migrations without a path list.

Testing

  • New tests: the check and import each return a single object in the schema; the hook drops the tag only from deprecated operations; every settings module registers it after the marking hooks. Reverting the routing change makes the check's schema test fail.
  • Generated both schemas as generate_openapi_schemas.yml does:
    • CMS: none of the 14 deprecated operations keep the SDK tag; the 16 /api/authoring/... operations do.
    • LMS: none of the 4 deprecated enrollment operations keep it; the 10 current /api/enrollment/v2/... operations do.
  • test_youtube_transcripts.py, cms/lib/tests/test_spectacular.py, views/tests/test_transcripts.py, cms/tests.py, lms/tests.py: all pass.

The check was routed to the viewset's list action, so the schema described
its response as an array. It returns a single report, and clients generated
from the schema failed to parse it. Routing it to retrieve fixes the schema;
the address and behaviour are unchanged.
A legacy address kept for its deprecation window shares its view with the
replacement, so it inherited the openedx-platform-sdk tag and the SDK
generated a client for it. A post-processing hook now drops that tag from
every deprecated operation, in both services.

This branch has not been deployed

No deployments
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.

2 participants