Repository navigation
fix(differs.openapi): classify response enums by output compatibility - #59
Merged
Merged
Conversation
qballer
approved these changes
Nov 8, 2026
omermorad
added a commit
that referenced
this pull request
Nov 9, 2026
## Change Fix enum compatibility false negatives following #59. The shared walker retains simultaneous enum and const changes, so response `const: a` → `enum: [a, b]` and input `enum: [a, b]` → `const: a` require major bumps. Preserve minor recommendations for equivalent const/singleton-enum substitutions. Equivalence is proven from both schema objects inside the walker, including JSON object key-order independence; raw changes remain complete. Coexisting constraints and unrelated same-name parameters cannot share equivalence evidence. JSON arrays and objects with numeric keys remain distinct values. Object comparisons require matching own keys, including JSON `__proto__` properties, so inherited properties cannot prove equivalence. Treat enum changes inside actual `oneOf` branches conservatively as breaking: exactly-one matching defeats branch-local subset reasoning. Equivalent substitutions remain compatible. Escape parameter names so names containing `/oneOf/0/` cannot imitate composition paths. ## Validation `pnpm build`, `pnpm lint`, changed-file ESLint, and `pnpm test` pass (46 tests). `pnpm test:e2e` passes (361 passed, 1 skipped). The original six interaction regressions fail against the previous implementation. Independent rereview passed 51 tests/probes, including the original findings, same-name query/header collision, and 100 enum/const/coexisting-constraint pairs; no actionable findings remain. `git diff --check` passes. ## Release impact Corrects missed changes, retains equivalent substitutions, and makes enum changes under `oneOf` conservative without proving branch disjointness. No package versions changed. Published consumers require a separately approved package/action release containing the fix; this PR does not authorize publishing, tags, or merging.
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.
Change
Classify response enum widening as breaking and narrowing as non-breaking, including adding/removing the enum or const constraint. Preserve request compatibility and keep const replacements breaking in both directions. This follows compatible API extension guidance: existing clients may validate responses against their original enum.
Validation
pnpm build,pnpm lint, andpnpm testpass (30 tests, including 16 new directional cases).pnpm test:e2epasses (361 passed, 1 skipped). The regression suite fails 6 cases against the previous classifier.git diff --checkpasses.Release impact
Corrects response enum severity and resulting version bump recommendations. No package versions changed. Consumers of published
@contractual/differs.openapi@0.1.0-beta.2still need a separately approved package/action release containing this fix; this PR does not authorize publishing or tag changes.