Add comprehensive OpenAPI 3.1 support with JSON Schema 2020-12 validation #2043
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.
Overview
This PR adds comprehensive support for OpenAPI 3.1, including JSON Schema 2020-12 validation and all major features introduced in the OpenAPI 3.1 specification. The implementation ensures proper handling of the enhanced schema validation capabilities while maintaining backward compatibility.
Key Features Added
1. JSON Schema 2020-12 Support
Draft202012Validator
for validating OpenAPI 3.1 schemasdraft2020_format_checker
for compatibility2. Type Arrays Support
type: ["string", "null"]
) to replace the deprecatednullable: true
property3. New JSON Schema Keywords
exclusiveMinimum
as a value rather than a boolean)4. Webhook Support
OpenAPI31Specification
class5. Minimal Documents
6. PathItems in Components
pathItems
in the Components Object7. Enhanced Security Features
8. Updated Example Application
Testing
Documentation
References
Acknowledgments
This work was inspired by and builds upon the initial efforts in PR #1951 as well as the valuable insights provided in Issue #1396 comment. We want to ensure proper credit is given to those who contributed ideas and initial implementations that helped shape this enhancement.