forked from getkin/kin-openapi
-
Notifications
You must be signed in to change notification settings - Fork 1
[TT-16407] OAS 3.1 Community PR #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
… added validation on content-type from encoding (getkin#1097)
The implementation provides complete OpenAPI 3.1 specification compliance while maintaining 100% backward compatibility with OpenAPI 3.0. Added full JSON Schema 2020-12 support with new fields: - **`Const`** - Constant value validation - **`Examples`** - Array of examples (replaces singular `example`) - **`PrefixItems`** - Tuple validation for arrays - **`Contains`, `MinContains`, `MaxContains`** - Array containment validation - **`PatternProperties`** - Pattern-based property matching - **`DependentSchemas`** - Conditional schema dependencies - **`PropertyNames`** - Property name validation - **`UnevaluatedItems`, `UnevaluatedProperties`** - Unevaluated keyword support - **Type arrays** - Support for `["string", "null"]` notation - **`Webhooks`** - New field for defining webhook callbacks (OpenAPI 3.1) - **`JSONSchemaDialect`** - Specifies default JSON Schema dialect - **Version detection methods**: - `IsOpenAPI3_0()` - Returns true for 3.0.x documents - `IsOpenAPI3_1()` - Returns true for 3.1.x documents - `Version()` - Returns major.minor version string - **`Identifier`** - SPDX license expression (alternative to URL) - **`Summary`** - Short summary of the API (OpenAPI 3.1) New methods for working with type arrays: - `IncludesNull()` - Checks if null type is included - `IsMultiple()` - Detects type arrays (OpenAPI 3.1 feature) - `IsSingle()` - Checks for single type - `IsEmpty()` - Checks for unspecified types A new opt-in validator using [santhosh-tekuri/jsonschema/v6](https://github.com/santhosh-tekuri/jsonschema): - Full JSON Schema Draft 2020-12 compliance - Automatic OpenAPI → JSON Schema transformation - Converts OpenAPI 3.0 `nullable` to type arrays - Handles `exclusiveMinimum`/`exclusiveMaximum` conversion - Comprehensive error formatting - Fallback to built-in validator on compilation errors
…d formatting and correcting the version logic
3633de3 to
f4b96b0
Compare
buraksezer
approved these changes
Jan 20, 2026
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.
Based on this Community PR: getkin#1102
This pull request modernizes the OpenAPI 3 package documentation and CI workflows. It adds comprehensive support and documentation for OpenAPI 3.1 features, including new schema fields, version detection, and JSON Schema 2020-12 validation options. Additionally, it replaces the previous CI workflows with a new, streamlined GitHub Actions workflow for linting and unit tests, and removes legacy workflows.
OpenAPI 3.1 Support and Documentation Enhancements:
.github/docs/openapi3.txtto document support for both OpenAPI 3.0.x and 3.1.x, including new features such as type arrays, JSON Schema 2020-12 keywords, webhooks, SPDX license identifiers, and JSON Schema dialect specification.summarytoInfo,identifiertoLicense, and multiple JSON Schema 2020-12 fields toSchema(e.g.,const,examples,prefixItems, etc.). [1] [2] [3]webhooksandjsonSchemaDialectfields to the rootTstruct.Typestype to support type arrays and added helper methods for type checks.IsOpenAPI3_0,IsOpenAPI3_1,Version). [1] [2]EnableJSONSchema2020for enabling JSON Schema 2020-12 validation.CI Workflow Modernization:
.github/workflows/ci-tests.ymlto run linting (viagolangci-lint) and unit tests, with improved caching and artifact upload..github/workflows/go.ymland the shell script linting workflow.github/workflows/shellcheck.yml, simplifying CI to focus on core Go checks and tests. [1] [2]