Skip to content

test: enforce oasdiff nullability and warning policy - #57

Closed
mojtaba-arvin wants to merge 12 commits into
ci/openapi-contract-central-gatefrom
test/oasdiff-nullability-warning-policy-stacked
Closed

mojtaba-arvin wants to merge 12 commits into
ci/openapi-contract-central-gatefrom
test/oasdiff-nullability-warning-policy-stacked

Conversation

@mojtaba-arvin

@mojtaba-arvin mojtaba-arvin commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Dependency

This PR is intentionally stacked on PR #54's ci/openapi-contract-central-gate branch. It preserves the reusable workflow and central-gate integration from #54, then tightens the same OpenAPI workflow's semantic checks. Merge #54 first, then retarget this PR to main and rerun the full gate.

Product decision

Treat both definite and potential breaking findings as release blockers. A WARN means the schema is insufficient to decide safely; it must not silently pass. Exceptions require a narrowly scoped severity override with a documented rationale and test.

Changes

  • Change baseline comparisons from --fail-on ERR to --fail-on WARN.
  • Add executable fixtures for OpenAPI 3.0 nullable: true, OpenAPI 3.1 null type unions, request/response directionality, pure oneOf and anyOf wrappers, and allOf + $ref.
  • Assert the exact v1.38.0 finding IDs: pure oneOf uses property nullability findings; the anyOf union is normalized to list-of-types findings, with request narrowing and response widening both treated as breaking.
  • Test nullable allOf + $ref without flattening; separately test --flatten-allof using request/response minLength changes. The pinned binary did not report the nullable transition when flattening was enabled, so baseline comparisons deliberately do not enable --flatten-allof.
  • Add a severity-override fixture that promotes a normally informational request-nullability finding to WARN and asserts that --fail-on WARN exits non-zero.
  • Keep request and response schemas independent in each fixture; combined CI caught and corrected an earlier fixture leak.
  • Pin Django 5.2.19, DRF 3.18.3, and drf-spectacular 0.30.0 exactly.
  • Upload generated candidate schemas immediately after generation, before semantic/baseline checks.
  • Keep oasdiff optional and outside runtime dependencies; retain the v1.38.0 archive SHA-256 verification.

Verification

Latest head: ba8bdf73c32a735705ef0382a1e4785ec2adcdb2. The exact semantic suite passes on combined PR #58 head 288e790545cdfc553302951dcf9274e9e3a29ccb. This PR is stacked on a non-default base branch, so its own pull-request workflow (filtered to main) does not run; full integration evidence is being gathered on #58.

Copy link
Copy Markdown
Owner Author

Superseded by the consolidated integration PR #58, which includes this work and passed the complete required PR gate on exact head 98f79472777f9e8e0bbf78c16531d97a46ad0a3a. The consolidated change is now merged to main as a8b39343c478bb5a8afbe1de20d95a2b10630f37. Closing this focused PR to avoid leaving duplicate, already-integrated branches open; its implementation history remains in the PR conversation and the consolidated merge.

@mojtaba-arvin
mojtaba-arvin deleted the test/oasdiff-nullability-warning-policy-stacked branch November 19, 2026 09:35
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.

1 participant