Skip to content

Commit 0a134a1

Browse files
committed
add kotlin project compile check test for include-http-request-context
1 parent 8ce6c62 commit 0a134a1

51 files changed

Lines changed: 2321 additions & 64 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
generatorName: kotlin-spring
2+
outputDir: samples/server/petstore/kotlin-springboot-include-http-request-context-delegate.yaml
3+
library: spring-boot
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
6+
additionalProperties:
7+
documentationProvider: none
8+
annotationLibrary: swagger1
9+
useSwaggerUI: false
10+
serviceImplementation: false
11+
skipDefaultInterface: true
12+
interfaceOnly: false
13+
serializableModel: true
14+
beanValidations: true
15+
includeHttpRequestContext: true
16+
reactive: true
17+
delegatePattern: true

bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ library: spring-boot
44
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml
55
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
66
additionalProperties:
7-
documentationProvider: none
8-
annotationLibrary: none
7+
documentationProvider: springdoc
8+
annotationLibrary: swagger2
99
useSwaggerUI: false
1010
serviceImplementation: false
1111
skipDefaultInterface: true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
README.md
2+
build.gradle.kts
3+
gradle/wrapper/gradle-wrapper.jar
4+
gradle/wrapper/gradle-wrapper.properties
5+
gradlew
6+
gradlew.bat
7+
pom.xml
8+
settings.gradle
9+
src/main/kotlin/org/openapitools/Application.kt
10+
src/main/kotlin/org/openapitools/api/ApiUtil.kt
11+
src/main/kotlin/org/openapitools/api/PetApi.kt
12+
src/main/kotlin/org/openapitools/api/PetApiController.kt
13+
src/main/kotlin/org/openapitools/api/PetApiDelegate.kt
14+
src/main/kotlin/org/openapitools/api/StoreApi.kt
15+
src/main/kotlin/org/openapitools/api/StoreApiController.kt
16+
src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt
17+
src/main/kotlin/org/openapitools/api/UserApi.kt
18+
src/main/kotlin/org/openapitools/api/UserApiController.kt
19+
src/main/kotlin/org/openapitools/api/UserApiDelegate.kt
20+
src/main/kotlin/org/openapitools/configuration/EnumConverterConfiguration.kt
21+
src/main/kotlin/org/openapitools/model/Cat.kt
22+
src/main/kotlin/org/openapitools/model/Category.kt
23+
src/main/kotlin/org/openapitools/model/Color.kt
24+
src/main/kotlin/org/openapitools/model/Dog.kt
25+
src/main/kotlin/org/openapitools/model/ModelApiResponse.kt
26+
src/main/kotlin/org/openapitools/model/Order.kt
27+
src/main/kotlin/org/openapitools/model/Pet.kt
28+
src/main/kotlin/org/openapitools/model/Tag.kt
29+
src/main/kotlin/org/openapitools/model/User.kt
30+
src/main/resources/application.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.18.0-SNAPSHOT
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# openAPIPetstore
2+
3+
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).
4+
5+
## Getting Started
6+
7+
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.
8+
9+
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).
10+
11+
To build the project using maven, run:
12+
```bash
13+
mvn package && java -jar target/openapi-spring-1.0.0.jar
14+
```
15+
16+
To build the project using gradle, run:
17+
```bash
18+
gradle build && java -jar build/libs/openapi-spring-1.0.0.jar
19+
```
20+
21+
If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
buildscript {
4+
repositories {
5+
mavenCentral()
6+
}
7+
dependencies {
8+
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.6.7")
9+
}
10+
}
11+
12+
group = "org.openapitools"
13+
version = "1.0.0"
14+
15+
repositories {
16+
mavenCentral()
17+
}
18+
19+
tasks.withType<KotlinCompile> {
20+
kotlinOptions.jvmTarget = "11"
21+
}
22+
23+
plugins {
24+
val kotlinVersion = "1.9.25"
25+
id("org.jetbrains.kotlin.jvm") version kotlinVersion
26+
id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion
27+
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion
28+
id("org.springframework.boot") version "2.6.7"
29+
id("io.spring.dependency-management") version "1.0.11.RELEASE"
30+
}
31+
32+
dependencies {
33+
val kotlinxCoroutinesVersion = "1.6.1"
34+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
35+
implementation("org.jetbrains.kotlin:kotlin-reflect")
36+
implementation("org.springframework.boot:spring-boot-starter-webflux")
37+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
38+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion")
39+
implementation("io.swagger:swagger-annotations:1.6.6")
40+
41+
implementation("com.google.code.findbugs:jsr305:3.0.2")
42+
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
43+
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
44+
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
45+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
46+
implementation("javax.validation:validation-api")
47+
implementation("javax.annotation:javax.annotation-api:1.3.2")
48+
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
49+
testImplementation("org.springframework.boot:spring-boot-starter-test") {
50+
exclude(module = "junit")
51+
}
52+
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion")
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)