feat!: make #[EnumValue] control per-case enum schema exposure - #826
Merged
oojacoboo merged 1 commit intoAug 19, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #826 +/- ##
============================================
- Coverage 95.72% 91.72% -4.00%
- Complexity 1773 2027 +254
============================================
Files 154 199 +45
Lines 4586 5439 +853
============================================
+ Hits 4390 4989 +599
- Misses 196 450 +254 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Once any case of a #[Type]-mapped enum carries #[EnumValue], the enum enters opt-in mode: only annotated cases are exposed and unannotated cases are hidden from the schema. A fully-unannotated mapped enum stays in legacy mode (every case exposed) and emits the existing deprecation advisory. Adds Types\ExposedEnumCase and reshapes EnumType's internal constructor to take the resolved exposed cases the mapper decided, replacing the parallel per-name metadata arrays. BREAKING CHANGE: partially-annotated #[Type] enums now hide their unannotated cases from the schema. Annotate every case you want exposed.
oojacoboo
force-pushed
the
feat/enumvalue-schema-exposure-upstream
branch
from
August 19, 2026 16:47
0cd846f to
42b0fd0
Compare
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.
Builds on #793 (which added
#[EnumValue]for per-case metadata). This makes#[EnumValue]the schema-exposure toggle for#[Type]-mapped enums, mirroring#[Field]'s opt-in model on classes.Behavior
Once any case of a mapped enum carries
#[EnumValue], the enum enters opt-in mode: only annotated cases are exposed, and unannotated cases are hidden from the schema. A fully-unannotated mapped enum stays in legacy mode (every case exposed) and keeps emitting the existing deprecation advisory.Implementation
Types\ExposedEnumCaseand reshapesEnumType's internal constructor to take the resolved exposed cases the mapper decided, replacing the parallel per-name metadata arrays.EnumTypeMapperbuckets cases in a single pass, preserving deprecation precedence (explicit#[EnumValue(deprecationReason:)]wins, an empty string clears, otherwise the@deprecateddocblock is honored).Breaking change
Partially-annotated
#[Type]enums now hide their unannotated cases from the schema. Annotate every case you want exposed.Docs updated (
attributes-reference,descriptions); tests added (EnumExposureTest+ fixtures, covering opt-in, legacy, and mixed enums).