Upgrade to OpenAPI 3.1.0 support#20
Open
charliekump-wf wants to merge 2 commits into
Open
Conversation
Migrate from `openapiv3` crate (3.0.x only) to `oas3` crate which natively supports OpenAPI 3.1.0. This is a breaking change for the parsing library but preserves all existing functionality. Key changes: - Replace openapiv3 with oas3 v0.21 (includes built-in YAML support) - Rewrite schema handling for oas3's flat ObjectSchema model vs openapiv3's SchemaKind enum - Update all test fixtures from openapi 3.0.2 to 3.1.0 - Update snapshots for property ordering and schema kind changes
PatOConnor43
left a comment
Owner
There was a problem hiding this comment.
A couple questions for you
| } | ||
| }; | ||
|
|
||
| match primary_type { |
Owner
There was a problem hiding this comment.
This implementation is probably fine on the request side since the user will almost definitely need to make changes to the body and adding both potential types to the body is nonsense.
| path: "/pets", | ||
| }, | ||
| kind: "Any", | ||
| kind: "OneOf", |
Owner
There was a problem hiding this comment.
I think all of these snapshots where the kind of the diagnostic changed are indicative of different behavior? Shouldn't this continue to return Any as the name of the file implies?
| #jsonpath "$.category" isCollection | ||
| #jsonpath "$.category.id" isInteger | ||
| #jsonpath "$.category.name" isString | ||
| #jsonpath "$.id" isInteger |
Owner
There was a problem hiding this comment.
alphabetized output on asserts is an acceptable change for the snapshots 👍
- Revert all existing test fixtures back to openapi 3.0.2, preserving
the original OAS 3.0 test suite and snapshots
- Fix multi-composition-keyword handling: when multiple composition
keywords (oneOf/allOf/anyOf) are present simultaneously, emit
UnsupportedSchemaKind("Any") diagnostic instead of silently processing
the first one found
- Fix multi-type assert generation: when a schema has multiple non-null
types (e.g. type: ["integer", "string"]), generate commented-out
assert alternatives for each type so the user can pick
- Add separate OAS 3.1 test fixtures and tests (oas31_petstore,
oas31_diagnostic_inputs) exercising 3.1 features like nullable types
and multi-type schemas
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.
Summary
openapiv3crate (3.0.x only) tooas3crate (v0.21) which natively supports OpenAPI 3.1.0ObjectSchemamodel vs openapiv3'sSchemaKindenumopenapi: 3.0.2toopenapi: 3.1.0and regenerate snapshotsTest plan
cargo test)RUSTFLAGS="-Dwarnings" cargo build).hurlfiles are functionally equivalent🤖 Generated with Claude Code