-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
fix: normalize OAS 3.1 schemas with type:[object,"null"] to set nullable:true correctly #24140
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
wing328
merged 19 commits into
OpenAPITools:master
from
Picazsoo:bugfix/fix-nullable-open-api-3.1
Jun 28, 2026
+144
−6
Merged
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
29c6207
fix: normalize OAS 3.1 schemas with type:[object,"null"] to set nulla…
Picazsoo cb5aa49
fix: ensure OAS 3.1 schemas with type array including "null" set null…
Picazsoo b0d188d
Revert "fix: ensure OAS 3.1 schemas with type array including "null" …
Picazsoo 74eb333
Reapply "fix: ensure OAS 3.1 schemas with type array including "null"…
Picazsoo 6a4bd10
add whitespace to retrigger tests
Picazsoo 68e6dff
Revert "add whitespace to retrigger tests"
Picazsoo 7f0b9a6
Revert "Reapply "fix: ensure OAS 3.1 schemas with type array includin…
Picazsoo 500d93a
Reapply "fix: ensure OAS 3.1 schemas with type array including "null"…
Picazsoo cf56cf5
Revert "fix: ensure OAS 3.1 schemas with type array including "null" …
Picazsoo f741e48
Revert "fix: normalize OAS 3.1 schemas with type:[object,"null"] to s…
Picazsoo 39ae5a2
Reapply "fix: normalize OAS 3.1 schemas with type:[object,"null"] to …
Picazsoo fbd542d
Reapply "fix: ensure OAS 3.1 schemas with type array including "null"…
Picazsoo 080e3e2
Revert "Reapply "fix: ensure OAS 3.1 schemas with type array includin…
Picazsoo de3e753
Reapply "Reapply "fix: ensure OAS 3.1 schemas with type array includi…
Picazsoo a275fa0
Reapply "add whitespace to retrigger tests"
Picazsoo 7eca935
ci: replace setup-cpp with apt-get in node2 to fix transient GPG key …
Picazsoo c327dfc
fix: add explicit source directory '.' to cmake invocation in cpp-res…
Picazsoo c2169e6
fix: force clang compiler in cpp-restsdk cmake invocation
Picazsoo b7807bd
ci: remove unnecessary ninja-build from node2 apt install
Picazsoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
37 changes: 37 additions & 0 deletions
37
modules/openapi-generator/src/test/resources/3_1/issue_24139.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| openapi: 3.1.1 | ||
| info: | ||
| title: Test issue 24139 | ||
| version: 1.0.0 | ||
|
|
||
| components: | ||
| schemas: | ||
| NestedNullable: | ||
| type: [ object, "null" ] | ||
| properties: | ||
| value: | ||
| type: [ number, "null" ] | ||
| Nested: | ||
| type: object | ||
| properties: | ||
| value: | ||
| type: [ number, "null" ] | ||
| # OAS 3.1 allows object schemas with properties but no explicit type declaration. | ||
| # This must not lose its properties after normalization. | ||
| ImpliedObject: | ||
| properties: | ||
| name: | ||
| type: string | ||
|
|
||
| Item: | ||
| type: object | ||
| properties: | ||
| nestedNullable: | ||
| $ref: '#/components/schemas/NestedNullable' | ||
|
|
||
| nestedNullable2: | ||
| anyOf: | ||
| - $ref: '#/components/schemas/Nested' | ||
| - type: 'null' | ||
|
|
||
| nested: | ||
| $ref: '#/components/schemas/Nested' |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.