Skip to content

fix(differs.openapi): account for enum constraint interactions - #60

Merged
omermorad merged 3 commits into
nextfrom
fix/enum-composition-context
Nov 9, 2026
Merged

omermorad merged 3 commits into
nextfrom
fix/enum-composition-context

Conversation

@omermorad

@omermorad omermorad commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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.

@omermorad omermorad self-assigned this Nov 8, 2026
@omermorad
omermorad requested a review from qballer November 8, 2026 20:22
@omermorad
omermorad merged commit be669cf into next Nov 9, 2026
10 checks passed
@omermorad
omermorad deleted the fix/enum-composition-context branch November 9, 2026 06:29
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