-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
[Java] ensure JsonTypeName not generated for class implementing oneOf with discriminator #24024
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 13 commits into
OpenAPITools:master
from
jpfinne:hasDiscriminatorWithNonEmptyMapping
Jun 23, 2026
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
59c67f2
Merge pull request #4 from OpenAPITools/master
jpfinne 784da69
Merge branch 'OpenAPITools:master' into master
jpfinne 9ee6075
Merge branch 'OpenAPITools:master' into master
jpfinne 91ce7ba
Merge branch 'OpenAPITools:master' into master
jpfinne 0808d0e
Merge branch 'OpenAPITools:master' into master
jpfinne 46d9c9c
Merge branch 'OpenAPITools:master' into master
jpfinne 7b6cf90
Merge branch 'OpenAPITools:master' into master
jpfinne b50a337
Merge branch 'OpenAPITools:master' into master
jpfinne ae1bff7
Merge branch 'OpenAPITools:master' into master
jpfinne 9c059d1
Merge remote-tracking branch 'upstream/master'
jpfinne 2f6db3f
fix 23997: ensure that no JsonTypeName is created when the parent int…
jpfinne f11be05
add test for @JsonTypeInfo
jpfinne dc0d05b
Fix Cubic findings
jpfinne 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
68 changes: 68 additions & 0 deletions
68
modules/openapi-generator/src/test/resources/3_0/spring/issue_24003.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,68 @@ | ||
| openapi: 3.0.1 | ||
| info: | ||
| title: x-discriminator-value JsonTypeName bug | ||
| version: 1.0.0 | ||
| paths: | ||
| /locks: | ||
| get: | ||
| operationId: getLocks | ||
| responses: | ||
| '200': | ||
| description: list of locks | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/BrLock' | ||
| components: | ||
| schemas: | ||
| LockType: | ||
| type: string | ||
| enum: | ||
| - USER | ||
| - COMPONENT | ||
|
|
||
| BrLock: | ||
| type: object | ||
| required: | ||
| - lockType | ||
| properties: | ||
| lockType: | ||
| $ref: '#/components/schemas/LockType' | ||
| oneOf: | ||
| - $ref: '#/components/schemas/UserBrLock' | ||
| - $ref: '#/components/schemas/ComponentBrLock' | ||
| discriminator: | ||
| propertyName: lockType | ||
| mapping: | ||
| USER: '#/components/schemas/UserBrLock' | ||
| COMPONENT: '#/components/schemas/ComponentBrLock' | ||
|
|
||
| BaseBrLock: | ||
| type: object | ||
| required: | ||
| - lockType | ||
| properties: | ||
| lockType: | ||
| $ref: '#/components/schemas/LockType' | ||
|
|
||
| UserBrLock: | ||
| allOf: | ||
| - $ref: '#/components/schemas/BaseBrLock' | ||
| - type: object | ||
| required: | ||
| - userId | ||
| properties: | ||
| userId: | ||
| type: string | ||
|
|
||
| ComponentBrLock: | ||
| allOf: | ||
| - $ref: '#/components/schemas/BaseBrLock' | ||
| - type: object | ||
| required: | ||
| - componentId | ||
| properties: | ||
| componentId: | ||
| type: string |
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.