Expose redemption_status as an enum in the OpenAPI spec#3708
Merged
Conversation
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
The ManagerEnrollmentCodeSerializer.redemption_status SerializerMethodField was annotated only as `-> str`, so drf-spectacular emitted a bare `type: string` with no enum. Decorate the getter with `@extend_schema_field(ChoiceField(choices=REDEMPTION_STATUSES))` so the spec advertises the three valid values, and add REDEMPTION_STATUSES as a single source of truth alongside the existing REDEMPTION_STATUS_* constants. oasdiff flags the enum-ization as a response property type change (the inline `type: string` moves onto the referenced enum schema), so add err-ignore entries marking it as a spec correction rather than a behavioral break. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These entries suppressed breaking changes from already-merged PRs (page nullability, min/max_price int->number, partner_schools required props, codes bulk_assign/assign/remind/revoke shape changes). Those changes are now present in both the base (main) and head specs, so oasdiff no longer reports them and the ignore entries never match. Verified: with these removed, oasdiff breaking (main vs this branch) reports no breaking changes across v0/v1/v2 beyond the redemption_status enum correction. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8d9c14d to
bb6cc7c
Compare
7 tasks
dsubak
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
None
Description (What does it do?)
Makes redemption_status an enum.
How can this be tested?
CI should pass.
Additional Context
The frontend has been patching the enum type on; let's just get it from the spec.
https://github.com/mitodl/mit-learn/pull/3530/changes#diff-bf61d750bba151d3b8c7df563af5d15b4695ed7fc5d59fa22e2851069e2cc2d6R14-R16