-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
fix(kotlin-spring): add parentCtorCallNeeded model template property #17008
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
petermetz
wants to merge
1
commit into
OpenAPITools:master
Choose a base branch
from
petermetz:petermetz/issue8366
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.
Open
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
12 changes: 12 additions & 0 deletions
12
bin/configs/kotlin-spring-issue8366-inheritance-parent-ctor-call.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,12 @@ | ||
| generatorName: kotlin-spring | ||
| outputDir: samples/server/petstore/kotlin-spring-issue8366-inheritance-parent-ctor-call | ||
| library: spring-boot | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/issue8366-inheritance-parent-ctor-call.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/kotlin-spring | ||
| additionalProperties: | ||
| documentationProvider: springdoc | ||
| annotationLibrary: swagger2 | ||
| useSwaggerUI: "true" | ||
| serviceImplementation: "true" | ||
| reactive: "true" | ||
| beanValidations: "false" | ||
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
93 changes: 93 additions & 0 deletions
93
...enapi-generator/src/test/resources/3_0/kotlin/issue8366-inheritance-parent-ctor-call.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,93 @@ | ||
| openapi: 3.0.3 | ||
| info: | ||
| version: "1.0.0" | ||
| title: "" | ||
| paths: | ||
| /documents/v1: | ||
| get: | ||
| responses: | ||
| 200: | ||
| description: lorem | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: array | ||
| items: | ||
| $ref: "#/components/schemas/ParentSchema" | ||
| components: | ||
| schemas: | ||
| JarFiles: | ||
| type: array | ||
| items: | ||
| $ref: "#/components/schemas/JarFile" | ||
| JarFile: | ||
| type: object | ||
| required: | ||
| - filename | ||
| - contentBase64 | ||
| - hasDbMigrations | ||
| additionalProperties: true | ||
| properties: | ||
| filename: | ||
| type: string | ||
| nullable: false | ||
| minLength: 1 | ||
| maxLength: 255 | ||
| hasDbMigrations: | ||
| description: Indicates whether the cordapp jar in question contains any | ||
| embedded migrations that Cactus can/should execute between copying the | ||
| jar into the cordapp directory and starting the node back up. | ||
| type: boolean | ||
| nullable: false | ||
| contentBase64: | ||
| type: string | ||
| format: base64 | ||
| nullable: false | ||
| minLength: 1 | ||
| maxLength: 1073741824 | ||
|
|
||
| ParentSchema: | ||
| type: object | ||
| properties: | ||
| id: | ||
| type: string | ||
| type: | ||
| $ref: "#/components/schemas/DiscriminatingType" | ||
| discriminator: | ||
| propertyName: type | ||
| mapping: | ||
| subtypeA: "#/components/schemas/SubtypeA" | ||
| subtypeB: "#/components/schemas/SubtypeB" | ||
| subtypeC: "#/components/schemas/SubtypeC" | ||
| SubtypeA: | ||
| type: object | ||
| allOf: | ||
| - $ref: '#/components/schemas/ParentSchema' | ||
| - type: object | ||
| properties: | ||
| subtypeAproperty: | ||
| type: integer | ||
| SubtypeB: | ||
| type: object | ||
| allOf: | ||
| - $ref: '#/components/schemas/ParentSchema' | ||
| - type: object | ||
| properties: | ||
| subtypeBproperty: | ||
| type: string | ||
| SubtypeC: | ||
| type: object | ||
| additionalProperties: true | ||
| allOf: | ||
| - $ref: '#/components/schemas/ParentSchema' | ||
| - type: object | ||
| properties: | ||
| subtypeAproperty: | ||
| type: integer | ||
|
|
||
| DiscriminatingType: | ||
| type: string | ||
| enum: | ||
| - subtypeA | ||
| - subtypeB | ||
| - subtypeC |
23 changes: 23 additions & 0 deletions
23
...r/petstore/kotlin-spring-issue8366-inheritance-parent-ctor-call/.openapi-generator-ignore
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,23 @@ | ||
| # OpenAPI Generator Ignore | ||
| # Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
|
||
| # Use this file to prevent files from being overwritten by the generator. | ||
| # The patterns follow closely to .gitignore or .dockerignore. | ||
|
|
||
| # As an example, the C# client generator defines ApiClient.cs. | ||
| # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
| #ApiClient.cs | ||
|
|
||
| # You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
| #foo/*/qux | ||
| # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
|
||
| # You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
| #foo/**/qux | ||
| # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
|
||
| # You can also negate patterns with an exclamation (!). | ||
| # For example, you can ignore all files in a docs folder with the file extension .md: | ||
| #docs/*.md | ||
| # Then explicitly reverse the ignore rule for a single file: | ||
| #!docs/README.md |
23 changes: 23 additions & 0 deletions
23
...er/petstore/kotlin-spring-issue8366-inheritance-parent-ctor-call/.openapi-generator/FILES
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,23 @@ | ||
| README.md | ||
| build.gradle.kts | ||
| gradle/wrapper/gradle-wrapper.jar | ||
| gradle/wrapper/gradle-wrapper.properties | ||
| gradlew | ||
| gradlew.bat | ||
| pom.xml | ||
| settings.gradle | ||
| src/main/kotlin/org/openapitools/Application.kt | ||
| src/main/kotlin/org/openapitools/HomeController.kt | ||
| src/main/kotlin/org/openapitools/api/ApiUtil.kt | ||
| src/main/kotlin/org/openapitools/api/DocumentsApiController.kt | ||
| src/main/kotlin/org/openapitools/api/DocumentsApiService.kt | ||
| src/main/kotlin/org/openapitools/api/DocumentsApiServiceImpl.kt | ||
| src/main/kotlin/org/openapitools/configuration/EnumConverterConfiguration.kt | ||
| src/main/kotlin/org/openapitools/model/DiscriminatingType.kt | ||
| src/main/kotlin/org/openapitools/model/JarFile.kt | ||
| src/main/kotlin/org/openapitools/model/ParentSchema.kt | ||
| src/main/kotlin/org/openapitools/model/SubtypeA.kt | ||
| src/main/kotlin/org/openapitools/model/SubtypeB.kt | ||
| src/main/kotlin/org/openapitools/model/SubtypeC.kt | ||
| src/main/resources/application.yaml | ||
| src/main/resources/openapi.yaml |
1 change: 1 addition & 0 deletions
1
.../petstore/kotlin-spring-issue8366-inheritance-parent-ctor-call/.openapi-generator/VERSION
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 @@ | ||
| 7.24.0-SNAPSHOT |
21 changes: 21 additions & 0 deletions
21
.../server/petstore/kotlin-spring-issue8366-inheritance-parent-ctor-call/README.md
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,21 @@ | ||
| # | ||
|
|
||
| This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). | ||
|
|
||
| ## Getting Started | ||
|
|
||
| This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in. | ||
|
|
||
| By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl). | ||
|
|
||
| To build the project using maven, run: | ||
| ```bash | ||
| mvn package && java -jar target/openapi-spring-1.0.0.jar | ||
| ``` | ||
|
|
||
| To build the project using gradle, run: | ||
| ```bash | ||
| gradle build && java -jar build/libs/openapi-spring-1.0.0.jar | ||
| ``` | ||
|
|
||
| If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/) |
Oops, something went wrong.
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.
please add the new output folder to https://github.com/OpenAPITools/openapi-generator/blob/master/.github/workflows/samples-kotlin-server.yaml so that CI will test it moving forward.
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 I've updated it as requested, thank you for the review!