feat(oas32): add initial OAS 3.2.0 support#4153
Draft
robert-hebel-sb wants to merge 10 commits intomasterfrom
Draft
feat(oas32): add initial OAS 3.2.0 support#4153robert-hebel-sb wants to merge 10 commits intomasterfrom
robert-hebel-sb wants to merge 10 commits intomasterfrom
Conversation
Fix dereference strategy to extend OpenAPI3_2DereferenceStrategy instead of OpenAPI3_1DereferenceStrategy, enabling proper matching of OpenAPI 3.2 files. Update tests to use correct API interface and reflect that isOpenAPI3 now includes 3.2 support. Adjust webpack bundle size limits to accommodate new ApiDOM dependencies. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add OpenAPI 3.2 predicate function and integrate 3.2 resolution strategies, parsers, and dereference strategies into the main Swagger client. Update documentation to reflect 3.2 support and add necessary ApiDOM dependencies. Changes: - Add isOpenAPI32() predicate and update isOpenAPI3() to include 3.2 - Register openapi-3-2-apidom strategy in resolve and resolveSubtree - Add OpenAPI 3.2 JSON/YAML parsers and dereference strategy to apidom exports - Update CLAUDE.md and README.md with 3.2 compatibility information - Add @swagger-api/apidom-ns-openapi-3-2 dependency Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add full implementation of OpenAPI 3.2 swagger-client dereference strategy with feature parity to OAS 3.1, including: - Custom error handling with SchemaRefError - Path conversion and root cause extraction utilities - Complete visitor implementations for: - Reference resolution ($ref) - Schema Object dereferencing with $id/$anchor support - Path Item Object dereferencing - allOf merging with enum handling - Parameter and model property macros - Example Object external value resolution - Circular reference detection and handling - Meta patches support ($$ref) - Comprehensive error collection and reporting Update ESLint configuration to ignore OpenAPI 3.2 apidom-reference imports matching the pattern used for OAS 3.1. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add test suite for OpenAPI 3.2.0 dereference strategies covering: - Schema Object ($ref resolution, circular references, internal/external refs) - Parameter Object (components, path-level, operation-level) - Path Item Object (paths field, components/pathItems) - Response Object (components/responses) - Request Body Object (with allOf merging) - Reference Object (mixed references across locations) - Security Scheme Object (components/securitySchemes) Test structure: - 7 test suites with 15 passing tests - 26+ fixture files (root.json and dereferenced.json pairs) - Jest setup utility for OpenAPI 3.2 parsers and resolvers All tests follow patterns established in OpenAPI 3.1 test suite for consistency and maintainability. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…tegy Add comprehensive test coverage for OpenAPI 3.2.0 resolver strategy: Normalize tests (9 tests): - Header Object examples normalization - Parameter Object examples normalization - Operation.id fields normalization - Parameter Objects from path to operation level - Security Requirements Objects normalization - Server Objects normalization - Element compatibility checks - Idempotent normalization verification - POJO adapter caching Additional main tests (11 new tests): - parameterMacro option with Operation and Parameter Objects - parameterMacro with Parameter Object only (no operation) - parameterMacro error handling - modelPropertyMacro option with Schema Object properties - modelPropertyMacro error handling - Combined macros with allOf schema merging New fixtures: - circular-structures.json - parameter-macro.json - parameter-macro-no-operation.json - model-property-macro.json - model-property-macro-error.json - ref-all-of-macros.json - 6 normalize fixtures Test results: 29 tests passing (20 main + 9 normalize) All tests follow patterns established in OpenAPI 3.1 test suite. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive test coverage for OpenAPI 3.2.0 parser plugins: OpenAPI JSON 3.2 Parser Tests (12 tests): - File extension detection (.json) - Media type validation (proper/improper) - Unknown extension handling - No extension handling - Buffer and string data parsing - OpenAPI 3.2.0 detection from file data - Non-OpenAPI data coercion - Empty file handling - Source map support validation - Parse result verification OpenAPI YAML 3.2 Parser Tests (14 tests): - File extension detection (.yaml and .yml) - Media type validation (proper/improper) - Unknown extension handling - No extension handling - Buffer and string data parsing - OpenAPI 3.2.0 detection from file data - Non-OpenAPI data coercion - Empty file handling - Source map support validation - Parse result verification Test fixtures: - sample-api.json (comprehensive OpenAPI 3.2.0 spec) - sample-api.yaml (comprehensive OpenAPI 3.2.0 spec) Test results: 26 tests passing (12 JSON + 14 YAML) All tests follow patterns from OpenAPI 3.1 parser test suite. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Increases maxEntrypointSize from 570000 to 590000 bytes to accommodate the additional code required for OpenAPI 3.2 functionality. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
# Conflicts: # config/webpack/browser.config.babel.js # package-lock.json # package.json
Updates @swagger-api/apidom-* packages from 1.2.2 to 1.4.0 to support OpenAPI 3.2 functionality. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates both package.json and installation.md to include OpenAPI 3.0, 3.1, and 3.2 namespace packages and parser adapters in the optional dependencies override configuration for faster installation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Description
This PR adds support for OpenAPI 3.2.0 specification to swagger-js. The implementation includes:
Motivation and Context
OpenAPI 3.2.0 is the latest version of the OpenAPI Specification and includes important updates such as:
This change enables swagger-js to parse, resolve references, and execute operations defined in OpenAPI 3.2 specifications, maintaining compatibility with existing versions (2.0, 3.0.x, 3.1.x).
How Has This Been Tested?
Screenshots (if appropriate):
N/A
Types of changes
package.json)Checklist: