Skip to content

Commit c710711

Browse files
committed
set flow option default to false instead
1 parent 358e8af commit c710711

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

.github/workflows/samples-kotlin-server.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
- samples/server/petstore/kotlin-springboot-modelMutable
3636
- samples/server/petstore/kotlin-springboot-reactive
3737
- samples/server/petstore/kotlin-springboot-reactive-with-flow
38-
- samples/server/petstore/kotlin-springboot-reactive-without-flow
3938
- samples/server/petstore/kotlin-springboot-source-swagger1
4039
- samples/server/petstore/kotlin-springboot-source-swagger2
4140
- samples/server/petstore/kotlin-springboot-springfox

docs/generators/kotlin-spring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5252
|title|server title name or client service name| |OpenAPI Kotlin Spring|
5353
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
5454
|useFeignClientUrl|Whether to generate Feign client with url parameter.| |true|
55-
|useFlowForArrayReturnType|Whether to use Flow for array/collection return types when reactive is enabled. If false, will use List instead.| |true|
55+
|useFlowForArrayReturnType|Whether to use Flow for array/collection return types when reactive is enabled. If false, will use List instead.| |false|
5656
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
5757
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
5858
|useTags|Whether to use tags for creating interface and controller class names| |false|

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public String getDescription() {
147147
@Getter @Setter
148148
private boolean reactive = false;
149149
@Getter @Setter
150-
private boolean useFlowForArrayReturnType = true;
150+
private boolean useFlowForArrayReturnType = false;
151151
@Setter private boolean interfaceOnly = false;
152152
@Setter protected boolean useFeignClientUrl = true;
153153
@Setter protected boolean useFeignClient = false;

samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
8282
value = ["/pet/findByStatus"],
8383
produces = ["application/xml", "application/json"]
8484
)
85-
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<Flow<Pet>> {
85+
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
8686
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
8787
}
8888

@@ -100,7 +100,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
100100
value = ["/pet/findByTags"],
101101
produces = ["application/xml", "application/json"]
102102
)
103-
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<Flow<Pet>> {
103+
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
104104
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
105105
}
106106

samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface PetApiService {
3434
* or Invalid status value (status code 400)
3535
* @see PetApi#findPetsByStatus
3636
*/
37-
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): Flow<Pet>
37+
fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): List<Pet>
3838

3939
/**
4040
* GET /pet/findByTags : Finds Pets by tags
@@ -46,7 +46,7 @@ interface PetApiService {
4646
* @deprecated
4747
* @see PetApi#findPetsByTags
4848
*/
49-
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): Flow<Pet>
49+
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): List<Pet>
5050

5151
/**
5252
* GET /pet/{petId} : Find pet by ID

samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class PetApiServiceImpl : PetApiService {
1515
TODO("Implement me")
1616
}
1717

18-
override fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): Flow<Pet> {
18+
override fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): List<Pet> {
1919
TODO("Implement me")
2020
}
2121

22-
override fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): Flow<Pet> {
22+
override fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): List<Pet> {
2323
TODO("Implement me")
2424
}
2525

0 commit comments

Comments
 (0)