Skip to content

Add OpenAPI 3.1 paired-fixture test harness (Phase 0) - #961

Open
Inf1mum wants to merge 2 commits into
OpenAPITools:masterfrom
Inf1mum:feat/948-phase0-harness
Open

Inf1mum wants to merge 2 commits into
OpenAPITools:masterfrom
Inf1mum:feat/948-phase0-harness

Conversation

@Inf1mum

@Inf1mum Inf1mum commented Nov 16, 2026 •

Copy link
Copy Markdown

Fixes #948

Test-only groundwork for the 3.1 effort (Stage 1 plan): a fixture convention plus a harness (Oas31PairedFixturesTest) that keeps the "same change, same verdict in every version" contract visible while the engine grows 3.1 support.

The harness:

  • pins the documented 3.0→3.0 verdict per rule as a parameterized test, guarding the stage goal that 3.0 verdicts stay unchanged;
  • checks the Swagger 2.0 pair against the 3.0 verdict of the same rule;
  • holds the not-yet-working comparisons as disabled tests, each naming the phase that fixes it, so the build stays green.

Fixtures live in core/src/test/resources/oas31/<rule>/ (old/new × 3.0/3.1, the same minimal document in both syntaxes, one change per pair) for type-change, nullable, exclusive-bounds, array-items, all-of, one-of and swagger2.

The disabled tests document the known 3.1 gaps: same-version comparisons (3.1 type keyword, "null" nullability, numeric exclusiveMinimum, items and allOf/oneOf on non-ComposedSchema) until Phase 2 (#950), and cross-version comparisons plus version noise (#858) until Phase 3 (#951).

Verified: the build stays green; the disabled tests are the checklist each later phase un-disables when it lands.


Summary by cubic

Adds the paired-fixture test harness that Phase 0 of the OpenAPI 3.1 support plan (#948) builds on. For six rules, the same minimal change is expressed as a 3.0 pair and a 3.1 pair under core/src/test/resources/oas31/<rule>/; the one-of pair's INCOMPATIBLE verdict comes from removing a oneOf member, so it genuinely exercises composition comparison. The harness pins the documented 3.0→3.0 verdict, checks that a Swagger 2.0 pair for the type-change rule matches it, and keeps the comparisons that fail on today's engine as disabled tests so the build stays green.

Known gaps (disabled, with the phase that fixes each)

Written for commit bafe0c2. Summary will update on new commits.

View guided diff

Phase 0 of the OpenAPI 3.1 plan: the test setup every later phase uses.

Fixture convention under core/src/test/resources/oas31/<rule>/: the same
minimal document as old-3.0.yaml/new-3.0.yaml and old-3.1.yaml/new-3.1.yaml
so the same change is expressed in 3.0 and in 3.1 syntax. First fixtures:
type-change, nullable, exclusive-bounds, array-items, all-of, one-of, plus
one Swagger 2.0 pair.

Oas31PairedFixturesTest pins the documented 3.0->3.0 verdict per rule,
checks the Swagger 2.0 pair matches the 3.0 verdict, and keeps the parts
of the harness contract that fail on today's engine as disabled tests,
each naming the phase that fixes it:
- 3.1->3.1 verdict agreement: Phase 2 (OpenAPITools#950), engine reads 3.1 fields
- 3.0->3.1 verdict agreement and the 3.0-vs-3.1 written equivalence:
  Phase 3 (OpenAPITools#951), converter wired in

Fixes OpenAPITools#948

Signed-off-by: Inf1mum <vadimlazuk5@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 27 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Drop Gadget from WidgetCreateRequest's oneOf in the new specs (both
versions) and revert the doodad_prop1 type change, so the pinned
INCOMPATIBLE verdict depends on the oneOf member decrease instead of
an unrelated property type change. Remove the type: object lines
beside the request/response oneOf in the 3.0 files so the 3.0 and
3.1 pairs hold the same document.

Signed-off-by: Vadim Lazuk <vadimlazuk5@gmail.com>
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.

[OpenAPI 3.1] Phase 0: test harness for paired 3.0/3.1 fixtures

1 participant