Repository navigation
fix(differs.openapi): account for property addition constraints - #63
Merged
Merged
Conversation
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
Optional property additions could be classified as nonbreaking even when they invalidate existing consumers. For example, adding
task.progressto a response whose old parent hasadditionalProperties: falsepermits responses old clients reject; adding a typed request property to an open object rejects values previously allowed under that name.Carry the actual old/new parent context on named property additions and classify their value constraints in the input/output direction. Respect matching
patternProperties, schema-valuedadditionalProperties, requiredness, Boolean schemas and annotations. Mark non-monotonic or unsupported evaluation contexts conservatively breaking. Context comes from the walker rather than reconstructed display paths, including same-name parameters. The default JSON Schema differ policy is unchanged.OpenAPI 3.0 nullable types are normalized before implication checks; OpenAPI 3.1 keeps JSON Schema type semantics. Enum constraints remain intact, and cross-dialect comparisons are conservative. Explicit document, ancestor, and embedded JSON Schema dialects are checked before proving property compatibility; unsupported dialects require review. Dialect scanning visits schema locations, preserving ordinary JSON data and properties named
$schema.This is a bounded compatibility proof, not a general JSON Schema subset solver. Complex implications that cannot be proved remain conservatively breaking and may need manual review.
Validation
pnpm build,pnpm lint, direct ESLint for all changed files, formatting and whitespace checks passed.pnpm test: 97 passed, including 51 property-addition cases and all 38 existing OpenAPI tests.pnpm test:e2e: 361 passed, one existing skip.statsaddition stays nonbreaking.Release impact
OpenAPI consumers can receive a major-bump recommendation for property additions previously labeled nonbreaking. No package versions, release tags or publications are changed in this PR.