forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Kotlin-Spring] support to Spring boot3 & jakarta extension (OpenAPIT…
…ools#14369) * [Kotlin] add spring boot 3 & jakarta extension support * [kotlin-spring] readme update & modified imports * use latest Spring Boot starter parent * use same options as in [Java] generator * new config kotlin-spring-boot-3 --------- Co-authored-by: jayandran sampath <[email protected]>
- Loading branch information
Showing
108 changed files
with
1,992 additions
and
552 deletions.
There are no files selected for viewing
This file contains 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,46 @@ | ||
name: Samples Kotlin server | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'samples/server/petstore/kotlin-springboot-3*/**' | ||
pull_request: | ||
paths: | ||
- 'samples/server/petstore/kotlin-springboot-3*/**' | ||
|
||
env: | ||
GRADLE_VERSION: 7.4 | ||
|
||
jobs: | ||
build: | ||
name: Build Kotlin server | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sample: | ||
# server | ||
- samples/server/petstore/kotlin-springboot-3 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
- name: Cache maven dependencies | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: maven-repository | ||
with: | ||
path: | | ||
~/.gradle | ||
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
- name: Install Gradle wrapper | ||
uses: eskatos/gradle-command-action@v2 | ||
with: | ||
gradle-version: ${{ env.GRADLE_VERSION }} | ||
build-root-directory: ${{ matrix.sample }} | ||
arguments: wrapper | ||
- name: Build | ||
working-directory: ${{ matrix.sample }} | ||
run: ./gradlew build -x test |
This file contains 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,13 @@ | ||
generatorName: kotlin-spring | ||
outputDir: samples/server/petstore/kotlin-springboot-3 | ||
library: spring-boot | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring | ||
additionalProperties: | ||
documentationProvider: none | ||
annotationLibrary: none | ||
useSwaggerUI: "false" | ||
serviceImplementation: "true" | ||
serializableModel: "true" | ||
beanValidations: "true" | ||
useSpringBoot3: "true" |
This file contains 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 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 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 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 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 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 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
57 changes: 57 additions & 0 deletions
57
...rator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradle-sb3-Kts.mustache
This file contains 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,57 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
group = "{{groupId}}" | ||
version = "{{artifactVersion}}" | ||
java.sourceCompatibility = JavaVersion.VERSION_17 | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url = uri("https://repo.spring.io/milestone") } | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "17" | ||
} | ||
|
||
plugins { | ||
val kotlinVersion = "1.7.10" | ||
id("org.jetbrains.kotlin.jvm") version kotlinVersion | ||
id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion | ||
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion | ||
id("org.springframework.boot") version "3.0.2" | ||
id("io.spring.dependency-management") version "1.0.14.RELEASE" | ||
} | ||
|
||
dependencies { | ||
{{#reactive}} val kotlinxCoroutinesVersion = "1.6.1" | ||
{{/reactive}} implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect"){{^reactive}} | ||
implementation("org.springframework.boot:spring-boot-starter-web"){{/reactive}}{{#reactive}} | ||
implementation("org.springframework.boot:spring-boot-starter-webflux") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion"){{/reactive}}{{#springDocDocumentationProvider}}{{#useSwaggerUI}} | ||
implementation("org.springdoc:springdoc-openapi-starter-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-ui:2.0.0-M5"){{/useSwaggerUI}}{{^useSwaggerUI}} | ||
implementation("org.springdoc:springdoc-openapi-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-core:2.0.0-M5"){{/useSwaggerUI}}{{/springDocDocumentationProvider}}{{#springFoxDocumentationProvider}} | ||
implementation("io.springfox:springfox-swagger2:2.9.2"){{/springFoxDocumentationProvider}}{{#useSwaggerUI}}{{^springDocDocumentationProvider}} | ||
implementation("org.webjars:swagger-ui:4.10.3") | ||
implementation("org.webjars:webjars-locator-core"){{/springDocDocumentationProvider}}{{/useSwaggerUI}}{{^springFoxDocumentationProvider}}{{^springDocDocumentationProvider}}{{#swagger1AnnotationLibrary}} | ||
implementation("io.swagger:swagger-annotations:1.6.6"){{/swagger1AnnotationLibrary}}{{#swagger2AnnotationLibrary}} | ||
implementation("io.swagger.core.v3:swagger-annotations:2.2.0"){{/swagger2AnnotationLibrary}}{{/springDocDocumentationProvider}}{{/springFoxDocumentationProvider}} | ||
|
||
implementation("com.google.code.findbugs:jsr305:3.0.2") | ||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") | ||
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") | ||
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
{{#useBeanValidation}} | ||
implementation("jakarta.validation:jakarta.validation-api"){{/useBeanValidation}} | ||
implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") | ||
|
||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") | ||
testImplementation("org.springframework.boot:spring-boot-starter-test") { | ||
exclude(module = "junit") | ||
} | ||
{{#reactive}} | ||
testImplementation`("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion") | ||
{{/reactive}} | ||
} |
Oops, something went wrong.