Skip to content

Commit 2fb7b24

Browse files
committed
improve springBootApplication.mustache structure
1 parent eac10fd commit 2fb7b24

19 files changed

Lines changed: 20 additions & 43 deletions

File tree

  • modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot
  • samples/server/petstore
    • kotlin-spring-default/src/main/kotlin/org/openapitools
    • kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools
    • kotlin-springboot-3/src/main/kotlin/org/openapitools
    • kotlin-springboot-4/src/main/kotlin/org/openapitools
    • kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools
    • kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools
    • kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools
    • kotlin-springboot-delegate/src/main/kotlin/org/openapitools
    • kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools
    • kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools
    • kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools
    • kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools
    • kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools
    • kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools
    • kotlin-springboot-reactive/src/main/kotlin/org/openapitools
    • kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools
    • kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools
    • kotlin-springboot/src/main/kotlin/org/openapitools

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@ import org.springframework.context.annotation.ComponentScan
1111

1212
@SpringBootApplication
1313
@ComponentScan(basePackages = ["{{basePackage}}", "{{apiPackage}}", "{{modelPackage}}"])
14-
{{#openApiNullable}}
15-
class Application {
14+
class Application{{#openApiNullable}} {
1615
@Bean(name = ["{{basePackage}}.Application.jsonNullableModule"])
1716
fun jsonNullableModule(): Module = JsonNullableModule()
18-
}
19-
{{/openApiNullable}}
20-
{{^openApiNullable}}
21-
class Application
22-
{{/openApiNullable}}
17+
}{{/openApiNullable}}
2318

2419
fun main(args: Array<String>) {
2520
runApplication<Application>(*args)

samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/Application.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.ComponentScan
66

77
@SpringBootApplication
88
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
9-
class Application {
10-
}
9+
class Application
1110

1211
fun main(args: Array<String>) {
1312
runApplication<Application>(*args)

0 commit comments

Comments
 (0)