Skip to content

test: enforce oasdiff nullability and warning policy - #56

Closed
mojtaba-arvin wants to merge 6 commits into
mainfrom
test/oasdiff-nullability-warning-policy
Closed

mojtaba-arvin wants to merge 6 commits into
mainfrom
test/oasdiff-nullability-warning-policy

Conversation

@mojtaba-arvin

Copy link
Copy Markdown
Owner

Product decision

Treat both definite and potential breaking findings as release blockers in the consumer contract gate. 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.
  • Extend the semantic oasdiff verifier with executable fixtures for:
    • OpenAPI 3.0 nullable: true.
    • OpenAPI 3.1 type: [string, "null"].
    • Request vs response directionality in both nullable and non-nullable transitions.
    • Pure oneOf and anyOf null wrappers.
    • OpenAPI 3.0 allOf + $ref with --flatten-allof, covering the v1.38.0 regression fix.
  • Add a severity override fixture that promotes a normally informational request-nullability finding to WARN and asserts that --fail-on WARN exits non-zero. This tests the warning gate itself rather than relying on documentation alone.
  • Pin the consumer example's Django, DRF, and drf-spectacular versions exactly.
  • Document the warning policy, exception process, and fixture coverage in the example and design ADR.
  • Keep oasdiff optional and outside runtime dependencies. The existing v1.38.0 binary SHA-256 verification remains unchanged.

Research basis

  • oasdiff v1.38.0 is the released version used by the workflow.
  • Its nullability semantics are direction-sensitive: narrowing requests is breaking; widening responses is breaking.
  • v1.38.0 includes fixes for nullability through oneOf, anyOf, and allOf, including nullable allOf/$ref with flattening.
  • --fail-on WARN fails on both ERR and WARN findings.

Sources: oasdiff v1.38.0 release, nullability guide, breaking-change policy.

Verification

Latest head: 9d71d52d9dc05c17fa1f9cca24decdb9d1598b8d.

Fresh CI is required for the expanded semantic fixtures and strict warning gate. This PR is Draft and must not be considered complete until the OpenAPI contract job and central PR gate pass on this exact head.

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