Skip to content

fix: make the enrollment v2 schema match with API returns - #39120

Draft
Faraz32123 wants to merge 1 commit into
masterfrom
fix/enrollment_schema_matches_api_responses
Draft

Faraz32123 wants to merge 1 commit into
masterfrom
fix/enrollment_schema_matches_api_responses

Conversation

@Faraz32123

Copy link
Copy Markdown
Contributor

related PR: edly-io/openedx-platform-sdk#1

Make the enrollment v2 schema match what the API returns

Two places where the published schema disagreed with the actual responses.
Found while generating an SDK client — any generated client hits both.

  • Nullable course dates: enrollment_start, enrollment_end,
    course_start and course_end are null when a course has no dates set,
    but weren't declared nullable, so clients blew up parsing null.
  • Unpaginated list published as paginated: GET .../enrollment_allowed/
    returns a plain list, but @action inherits the viewset's
    pagination_class. Fixed with pagination_class=None.

No behaviour change — both fix the schema, not the endpoints.

Two places where the published schema disagreed with the actual responses,
both of which any generated client hits:

The course date fields are null for courses with no dates set, but weren't
declared nullable, so clients were told they're always present and blew up
parsing null.

The enrollment_allowed GET returns a plain list, but @action inherits the
viewset's pagination_class, so drf-spectacular published a paginated
envelope for it. The endpoint itself is unchanged — only the schema was
wrong.
Faraz32123 added a commit to edly-io/openedx-platform-sdk that referenced this pull request Sep 17, 2026
- regen_sdk.sh now takes PLATFORM_DIR or the schema URLs explicitly instead
  of inferring them, and prefixes the schema filenames per service
- moved the auth.py round-trip out of `sed -i ''` (BSD-only, failed on Linux
  after the tree was already removed) and into postprocess_sdk.py
- post-processing fails when a step patches nothing, and schema merges report
  their collisions, so a schema change can't quietly invalidate a fix
- the three platform schema workarounds name their exit path:
  openedx/openedx-platform#39120 for the two response-shape bugs,
  openedx/openedx-platform#39121 for the spurious path parameter
- pinned the workflow actions to SHAs and recorded the platform revision from
  the platform checkout rather than github.sha
- dropped the two unenroll request body models the API never accepts
@Faraz32123
Faraz32123 requested a review from feanil September 17, 2026 15:57
@Faraz32123 Faraz32123 self-assigned this Sep 17, 2026
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.

1 participant