-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[Java][Spring][Issue: 18929] fix missing JsonIgnoreProperties import in oneOf interface file #18930
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
ondrej-simon
wants to merge
1
commit into
OpenAPITools:master
from
ondrej-simon:b/18929-oneOf-within-oneOf
Closed
Changes from all commits
Commits
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
71 changes: 71 additions & 0 deletions
71
modules/openapi-generator/src/test/resources/3_0/spring/issue_18929.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,71 @@ | ||
| openapi: 3.0.3 | ||
| info: | ||
| title: oneOf within oneOf | ||
| version: 7.7.0-SNAPSHOT | ||
| paths: | ||
| /oneOf-within-oneOf-test: | ||
| post: | ||
| operationId: 'oneOfWithinOneOfTest' | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/RequestTwoSchema' | ||
| - $ref: '#/components/schemas/RequestOneSchema' | ||
| responses: | ||
| '201': | ||
| description: The request was successful and the resource has been created. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: string | ||
| components: | ||
| schemas: | ||
| AbstractNestedSchema: | ||
| type: object | ||
| discriminator: | ||
| propertyName: type | ||
| mapping: | ||
| NESTED_ONE: '#/components/schemas/NestedOneSchema' | ||
| NESTED_TWO: '#/components/schemas/NestedTwoSchema' | ||
| required: | ||
| - type | ||
| properties: | ||
| type: | ||
| type: string | ||
| NestedOneSchema: | ||
| type: object | ||
| allOf: | ||
| - $ref: '#/components/schemas/AbstractNestedSchema' | ||
| AbstractRequestSchema: | ||
| type: object | ||
| discriminator: | ||
| propertyName: type | ||
| mapping: | ||
| REQUEST_ONE: '#/components/schemas/RequestOneSchema' | ||
| REQUEST_TWO: '#/components/schemas/RequestTwoSchema' | ||
| required: | ||
| - type | ||
| properties: | ||
| type: | ||
| type: string | ||
| RequestTwoSchema: | ||
| type: object | ||
| allOf: | ||
| - $ref: '#/components/schemas/AbstractRequestSchema' | ||
| required: | ||
| - nested | ||
| properties: | ||
| nested: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/NestedTwoSchema' | ||
| - $ref: '#/components/schemas/NestedOneSchema' | ||
| RequestOneSchema: | ||
| type: object | ||
| allOf: | ||
| - $ref: '#/components/schemas/AbstractRequestSchema' | ||
| NestedTwoSchema: | ||
| type: object | ||
| allOf: | ||
| - $ref: '#/components/schemas/AbstractNestedSchema' |
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
43 changes: 43 additions & 0 deletions
43
...tore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PerkPersonApi.java
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,43 @@ | ||
| /** | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.7.0-SNAPSHOT). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
| package org.openapitools.api; | ||
|
|
||
| import org.openapitools.model.CreateParkPersonRequest; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.*; | ||
| import org.springframework.web.service.annotation.*; | ||
| import org.springframework.web.multipart.MultipartFile; | ||
|
|
||
| import org.springframework.http.codec.multipart.Part; | ||
| import reactor.core.publisher.Flux; | ||
| import reactor.core.publisher.Mono; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Optional; | ||
| import jakarta.annotation.Generated; | ||
|
|
||
|
|
||
| @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.7.0-SNAPSHOT") | ||
| public interface PerkPersonApi { | ||
|
|
||
| /** | ||
| * POST /fake/one-of-within-one-of-park-persons : Create a Park Person | ||
| * | ||
| * @param createParkPersonRequest (required) | ||
| * @return Park Person created (status code 201) | ||
| */ | ||
| @HttpExchange( | ||
| method = "POST", | ||
| value = "/fake/one-of-within-one-of-park-persons", | ||
| accept = { "application/json" }, | ||
| contentType = "application/json" | ||
| ) | ||
| Mono<ResponseEntity<String>> createParkPerson( | ||
| @RequestBody Mono<CreateParkPersonRequest> createParkPersonRequest | ||
| ); | ||
|
|
||
| } |
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.
@wing328 FYI as this will affect all Java codegen.
This is copying the behaviour that already exists in Java client though
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 removed the overrides from JavaClient and JavaHelidon, which were duplicates of this exact implementation. I presume this is what led to the bug in the first place - someone edited only the override in specialization and forgot about the parent method.