-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
fix #13150 Do not add schema / class name mapping where custom mapping exists #13815
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
Closed
bernie-schelberg-mywave
wants to merge
9
commits into
OpenAPITools:7.0.x
from
bernie-schelberg-mywave:issue13150-2
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
de1566c
fix #13150 Do not add schema / class name mapping where custom mappin…
bernie-schelberg-mywave 2bf0ea2
Fix Ruby tests
bernie-schelberg-mywave 18200c3
Merge branch 'master' into issue13150-2
bernie-schelberg-mywave 4571231
Add Java example
bernie-schelberg-mywave a1a26ea
Generate other samples
bernie-schelberg-mywave 17f8260
Change animal `type` property to `species`
bernie-schelberg-mywave 742ff17
Merge branch 'master' into issue13150-2
bernie-schelberg-mywave 6899d4b
Merge branch '7.0.x' into issue13150-2
bernie-schelberg-mywave 3247451
Generated samples after merging latest 7.0.x
bernie-schelberg-mywave 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
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
60 changes: 60 additions & 0 deletions
60
modules/openapi-generator/src/test/resources/bugs/issue_13150.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,60 @@ | ||
| openapi: '3.0.0' | ||
| info: | ||
| version: '1.0.0' | ||
| title: 'FooService' | ||
| paths: | ||
| /parent: | ||
| put: | ||
| summary: put parent | ||
| operationId: putParent | ||
| parameters: | ||
| - name: name | ||
| in: path | ||
| required: true | ||
| description: Name of the account being updated. | ||
| schema: | ||
| type: string | ||
| requestBody: | ||
| description: The updated account definition to save. | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Parent' | ||
| responses: | ||
| '200': | ||
| $ref: '#/components/responses/Parent' | ||
| components: | ||
| schemas: | ||
| Parent: | ||
| type: object | ||
| description: Defines an account by name. | ||
| properties: | ||
| name: | ||
| type: string | ||
| description: The account name. | ||
| type: | ||
| type: string | ||
| description: The account type discriminator. | ||
| required: | ||
| - name | ||
| - type | ||
| discriminator: | ||
| propertyName: type | ||
| mapping: | ||
| foo: '#/components/schemas/Foo' | ||
|
|
||
| Foo: | ||
| allOf: | ||
| - $ref: "#/components/schemas/Parent" | ||
| - type: object | ||
| properties: | ||
| fooType: | ||
| type: string | ||
| responses: | ||
| Parent: | ||
| description: The saved account definition. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Parent' |
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is changing - since this value previously would have been
nullThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, prior to this change
currentSchemaNamewas added as a mapping name on line 3365, and then another mapping was added on line 3371 if anx-discriminator-valuewas set. With this change, it's one or the other, not both.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this change is causing the issues you're seeing with Dart. I'd have to look more closely at how the schemas are being used later on, but this adds less schemas now; so perhaps some filterins logic is applied at some point?
I would try reverting this part of the change and see what the Dart output looks like.