-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Ref description override component #22114
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
Open
gcatanese
wants to merge
2
commits into
OpenAPITools:master
Choose a base branch
from
gcatanese:ref-description-override-component
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+166
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
111 changes: 111 additions & 0 deletions
111
modules/openapi-generator/src/test/resources/3_0/typescript/ref-description.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,111 @@ | ||
| openapi: 3.1.0 | ||
| info: | ||
| description: test order parameters | ||
| version: 1.0.0 | ||
| title: Test order parameters | ||
| license: | ||
| name: Apache-2.0 | ||
| url: 'https://www.apache.org/licenses/LICENSE-2.0.html' | ||
|
|
||
| paths: | ||
| /pets: | ||
| get: | ||
| tags: | ||
| - default | ||
| summary: Finds Pets | ||
| deprecated: true | ||
| description: Find all pets | ||
| operationId: findPets | ||
| parameters: | ||
| - name: type | ||
| in: query | ||
| description: type of pet | ||
| style: form | ||
| explode: false | ||
| schema: | ||
| type: string | ||
| default: available | ||
| - name: name | ||
| in: query | ||
| description: name of pet | ||
| required: true | ||
| schema: | ||
| type: string | ||
| - name: age | ||
| in: query | ||
| description: age of pet | ||
| schema: | ||
| type: number | ||
| format: int32 | ||
| responses: | ||
| '200': | ||
| description: successful operation | ||
| '400': | ||
| description: Invalid status value | ||
|
|
||
| patch: | ||
| tags: | ||
| - default | ||
| summary: Update a Pet | ||
| description: Partially update an existing pet | ||
| operationId: updatePet | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/PetUpdateRequest' | ||
| responses: | ||
| '200': | ||
| description: Pet updated successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Pet' | ||
| '400': | ||
| description: Invalid input | ||
| '404': | ||
| description: Pet not found | ||
|
|
||
| components: | ||
| schemas: | ||
| PetUpdateRequest: | ||
| type: object | ||
| description: Payload for updating a pet | ||
| properties: | ||
| name: | ||
| type: string | ||
| description: New name for the pet | ||
| age: | ||
| type: integer | ||
| format: int32 | ||
| description: Updated age | ||
| type: | ||
| type: string | ||
| description: Type of pet | ||
| date: | ||
| $ref: "#/components/schemas/Date" | ||
| description: Reference description of Date schema | ||
| required: | ||
| - name | ||
|
|
||
| Pet: | ||
| type: object | ||
| description: Pet object | ||
| properties: | ||
| id: | ||
| type: integer | ||
| format: int64 | ||
| name: | ||
| type: string | ||
| age: | ||
| type: integer | ||
| format: int32 | ||
| type: | ||
| type: string | ||
|
|
||
| Date: | ||
| type: string | ||
| format: date | ||
| description: Component description of Date schema | ||
|
|
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.
thanks for the fix
but this change will permanently update the description of the reference schema.
if the reference schema is used somewhere else, the description will be the overridden one instead of the original one.
i think a better way to fix it is in the
fromPropertyin default codegen. or maybe using normalizer to fix it.I'll try to find time to come up with a fix later this week
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.
fromPropertywhat do you mean? Please clarify, maybe I can update the approach