From 7916f2f880838041aa74ddc0f8922e7068341be8 Mon Sep 17 00:00:00 2001
From: sylvainmoindron <43030050+sylvainmoindron@users.noreply.github.com>
Date: Sun, 2 Jun 2019 21:50:45 +0200
Subject: [PATCH] [kotlin-spring] add reactive behavior via Kotlin coroutines
(#2934)
* kotlin spring : add reactivity via kotlin's coroutines
* add kotlin spring boot reactive samples
* bug : fix spring version and import for coroutines
* remove exception handler for reactive (webflux doesn't support it)
* add spring milestone repository to maven pom
* add reactive type for list in Api and ApiImpl methodes for mathching body responsive parameter
* fix baseType for ArraySchema
* regenerate samples
* updating documentation
---
bin/kotlin-springboot-petstore-all.sh | 4 +
...lin-springboot-petstore-server-reactive.sh | 35 ++++
.../kotlin-springboot-petstore-all.sh | 4 +
...lin-springboot-petstore-server-reactive.sh | 35 ++++
docs/generators/kotlin-spring.md | 3 +-
.../openapitools/codegen/DefaultCodegen.java | 2 +-
.../languages/KotlinSpringServerCodegen.java | 23 ++-
.../main/resources/kotlin-spring/api.mustache | 12 +-
.../kotlin-spring/bodyParams.mustache | 2 +-
.../spring-boot/buildGradleKts.mustache | 20 +-
.../libraries/spring-boot/pom.mustache | 53 ++++-
.../spring-boot/settingsGradle.mustache | 14 ++
.../kotlin-spring/returnTypes.mustache | 2 +-
.../resources/kotlin-spring/service.mustache | 6 +-
.../kotlin-spring/serviceImpl.mustache | 5 +-
.../codegen/java/JavaClientCodegenTest.java | 4 +-
.../codegen/java/JavaModelTest.java | 10 +-
.../spring/KotlinSpringServerCodegenTest.java | 6 +
samples/client/petstore/R/docs/UserApi.md | 4 +-
.../OpenAPIClient/docs/UserApi.md | 4 +-
.../csharp/OpenAPIClient/docs/UserApi.md | 4 +-
.../petstore/go/go-petstore/docs/UserApi.md | 4 +-
.../java/google-api-client/docs/UserApi.md | 4 +-
.../petstore/java/jersey1/docs/UserApi.md | 4 +-
.../java/jersey2-java6/docs/UserApi.md | 4 +-
.../java/jersey2-java8/docs/UserApi.md | 4 +-
.../petstore/java/jersey2/docs/UserApi.md | 4 +-
.../docs/UserApi.md | 4 +-
.../petstore/java/okhttp-gson/docs/UserApi.md | 4 +-
.../java/rest-assured/docs/UserApi.md | 4 +-
.../petstore/java/resteasy/docs/UserApi.md | 4 +-
.../java/resttemplate-withXml/docs/UserApi.md | 4 +-
.../java/resttemplate/docs/UserApi.md | 4 +-
.../java/retrofit2-play24/docs/UserApi.md | 4 +-
.../java/retrofit2-play25/docs/UserApi.md | 4 +-
.../java/retrofit2-play26/docs/UserApi.md | 4 +-
.../petstore/java/retrofit2/docs/UserApi.md | 4 +-
.../petstore/java/retrofit2rx/docs/UserApi.md | 4 +-
.../java/retrofit2rx2/docs/UserApi.md | 4 +-
.../petstore/java/vertx/docs/UserApi.md | 4 +-
.../petstore/java/webclient/docs/UserApi.md | 4 +-
.../petstore/javascript-es6/docs/UserApi.md | 4 +-
.../javascript-es6/src/api/UserApi.js | 4 +-
.../javascript-promise-es6/docs/UserApi.md | 4 +-
.../javascript-promise-es6/src/api/UserApi.js | 8 +-
.../javascript-promise/docs/UserApi.md | 4 +-
.../javascript-promise/src/api/UserApi.js | 8 +-
.../petstore/javascript/docs/UserApi.md | 4 +-
.../petstore/javascript/src/api/UserApi.js | 4 +-
.../petstore/kotlin-string/docs/UserApi.md | 4 +-
.../kotlin-threetenbp/docs/UserApi.md | 4 +-
.../client/petstore/kotlin/docs/UserApi.md | 4 +-
.../php/OpenAPIClient-php/docs/Api/UserApi.md | 8 +-
.../petstore/python-asyncio/docs/UserApi.md | 8 +-
.../petstore/python-tornado/docs/UserApi.md | 8 +-
.../client/petstore/python/docs/UserApi.md | 8 +-
samples/client/petstore/ruby/docs/UserApi.md | 8 +-
.../php/OpenAPIClient-php/docs/Api/UserApi.md | 8 +-
.../client/petstore/python/docs/UserApi.md | 8 +-
.../client/petstore/ruby/docs/UserApi.md | 8 +-
.../.openapi-generator-ignore | 23 +++
.../.openapi-generator/VERSION | 1 +
.../kotlin-springboot-reactive/README.md | 21 ++
.../build.gradle.kts | 55 ++++++
.../kotlin-springboot-reactive/pom.xml | 151 ++++++++++++++
.../settings.gradle | 15 ++
.../kotlin/org/openapitools/Application.kt | 14 ++
.../kotlin/org/openapitools/api/PetApi.kt | 186 ++++++++++++++++++
.../org/openapitools/api/PetApiService.kt | 23 +++
.../org/openapitools/api/PetApiServiceImpl.kt | 41 ++++
.../kotlin/org/openapitools/api/StoreApi.kt | 109 ++++++++++
.../org/openapitools/api/StoreApiService.kt | 14 ++
.../openapitools/api/StoreApiServiceImpl.kt | 24 +++
.../kotlin/org/openapitools/api/UserApi.kt | 172 ++++++++++++++++
.../org/openapitools/api/UserApiService.kt | 22 +++
.../openapitools/api/UserApiServiceImpl.kt | 40 ++++
.../kotlin/org/openapitools/model/Category.kt | 29 +++
.../org/openapitools/model/InlineObject.kt | 29 +++
.../org/openapitools/model/InlineObject1.kt | 29 +++
.../openapitools/model/ModelApiResponse.kt | 33 ++++
.../kotlin/org/openapitools/model/Order.kt | 60 ++++++
.../main/kotlin/org/openapitools/model/Pet.kt | 64 ++++++
.../main/kotlin/org/openapitools/model/Tag.kt | 29 +++
.../kotlin/org/openapitools/model/User.kt | 53 +++++
.../src/main/resources/application.yaml | 10 +
.../.openapi-generator/VERSION | 2 +-
.../kotlin-springboot/build.gradle.kts | 13 +-
.../petstore/kotlin-springboot/pom.xml | 36 +++-
.../kotlin-springboot/settings.gradle | 14 ++
.../kotlin/org/openapitools/api/PetApi.kt | 54 +++--
.../org/openapitools/api/PetApiService.kt | 17 +-
.../org/openapitools/api/PetApiServiceImpl.kt | 9 +-
.../kotlin/org/openapitools/api/StoreApi.kt | 31 ++-
.../org/openapitools/api/StoreApiService.kt | 9 +-
.../openapitools/api/StoreApiServiceImpl.kt | 1 -
.../kotlin/org/openapitools/api/UserApi.kt | 45 +++--
.../org/openapitools/api/UserApiService.kt | 17 +-
.../openapitools/api/UserApiServiceImpl.kt | 5 +-
.../kotlin/org/openapitools/model/Category.kt | 9 +-
.../org/openapitools/model/InlineObject.kt | 9 +-
.../org/openapitools/model/InlineObject1.kt | 11 +-
.../openapitools/model/ModelApiResponse.kt | 9 +-
.../kotlin/org/openapitools/model/Order.kt | 9 +-
.../main/kotlin/org/openapitools/model/Pet.kt | 9 +-
.../main/kotlin/org/openapitools/model/Tag.kt | 9 +-
.../kotlin/org/openapitools/model/User.kt | 9 +-
.../src/main/openapi/openapi.yaml | 2 -
.../jaxrs-spec/src/main/openapi/openapi.yaml | 2 -
.../.openapi-generator-ignore | 23 +++
.../.openapi-generator/VERSION | 1 +
.../kotlin-springboot-reactive/README.md | 21 ++
.../build.gradle.kts | 55 ++++++
.../kotlin-springboot-reactive/pom.xml | 151 ++++++++++++++
.../settings.gradle | 15 ++
.../kotlin/org/openapitools/Application.kt | 14 ++
.../kotlin/org/openapitools/api/PetApi.kt | 185 +++++++++++++++++
.../org/openapitools/api/PetApiService.kt | 23 +++
.../org/openapitools/api/PetApiServiceImpl.kt | 41 ++++
.../kotlin/org/openapitools/api/StoreApi.kt | 108 ++++++++++
.../org/openapitools/api/StoreApiService.kt | 14 ++
.../openapitools/api/StoreApiServiceImpl.kt | 24 +++
.../kotlin/org/openapitools/api/UserApi.kt | 162 +++++++++++++++
.../org/openapitools/api/UserApiService.kt | 22 +++
.../openapitools/api/UserApiServiceImpl.kt | 40 ++++
.../kotlin/org/openapitools/model/Category.kt | 29 +++
.../openapitools/model/ModelApiResponse.kt | 33 ++++
.../kotlin/org/openapitools/model/Order.kt | 60 ++++++
.../main/kotlin/org/openapitools/model/Pet.kt | 64 ++++++
.../main/kotlin/org/openapitools/model/Tag.kt | 29 +++
.../kotlin/org/openapitools/model/User.kt | 53 +++++
.../src/main/resources/application.yaml | 10 +
.../kotlin-springboot/build.gradle.kts | 13 +-
.../server/petstore/kotlin-springboot/pom.xml | 36 +++-
.../kotlin-springboot/settings.gradle | 14 ++
.../kotlin/org/openapitools/api/PetApi.kt | 5 +-
.../org/openapitools/api/PetApiService.kt | 17 +-
.../kotlin/org/openapitools/api/StoreApi.kt | 5 +-
.../org/openapitools/api/StoreApiService.kt | 9 +-
.../kotlin/org/openapitools/api/UserApi.kt | 5 +-
.../org/openapitools/api/UserApiService.kt | 17 +-
.../Resources/docs/Api/UserApiInterface.md | 4 +-
.../output/openapi-v3/docs/default_api.md | 4 +-
.../docs/user_api.md | 4 +-
.../java/org/openapitools/api/UserApi.java | 4 +-
.../org/openapitools/api/UserApiDelegate.java | 4 +-
.../src/main/resources/openapi.yaml | 2 -
146 files changed, 3078 insertions(+), 268 deletions(-)
create mode 100755 bin/kotlin-springboot-petstore-all.sh
create mode 100755 bin/kotlin-springboot-petstore-server-reactive.sh
create mode 100755 bin/openapi3/kotlin-springboot-petstore-all.sh
create mode 100755 bin/openapi3/kotlin-springboot-petstore-server-reactive.sh
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator-ignore
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/README.md
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/build.gradle.kts
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/pom.xml
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/settings.gradle
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/Application.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt
create mode 100644 samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/resources/application.yaml
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/.openapi-generator-ignore
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/README.md
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/build.gradle.kts
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/pom.xml
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/settings.gradle
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/Application.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt
create mode 100644 samples/server/petstore/kotlin-springboot-reactive/src/main/resources/application.yaml
diff --git a/bin/kotlin-springboot-petstore-all.sh b/bin/kotlin-springboot-petstore-all.sh
new file mode 100755
index 0000000000..b0ba7a6e82
--- /dev/null
+++ b/bin/kotlin-springboot-petstore-all.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+./bin/kotlin-springboot-petstore-server.sh
+./bin/kotlin-springboot-petstore-server-reactive.sh
\ No newline at end of file
diff --git a/bin/kotlin-springboot-petstore-server-reactive.sh b/bin/kotlin-springboot-petstore-server-reactive.sh
new file mode 100755
index 0000000000..f5e72350b6
--- /dev/null
+++ b/bin/kotlin-springboot-petstore-server-reactive.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+SCRIPT="$0"
+echo "# START SCRIPT: $SCRIPT"
+
+while [ -h "$SCRIPT" ] ; do
+ ls=$(ls -ld "$SCRIPT")
+ link=$(expr "$ls" : '.*-> \(.*\)$')
+ if expr "$link" : '/.*' > /dev/null; then
+ SCRIPT="$link"
+ else
+ SCRIPT=$(dirname "$SCRIPT")/"$link"
+ fi
+done
+
+if [ ! -d "${APP_DIR}" ]; then
+ APP_DIR=$(dirname "$SCRIPT")/..
+ APP_DIR=$(cd "${APP_DIR}"; pwd)
+fi
+
+executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
+
+if [ ! -f "$executable" ]
+then
+ mvn clean package
+fi
+
+export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
+ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot-reactive --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,reactive=true"
+
+echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot-reactive"
+rm -rf samples/server/petstore/kotlin-springboot-reactive
+
+echo "Generating Kotling Spring Boot reactive server..."
+java $JAVA_OPTS -jar $executable $ags
diff --git a/bin/openapi3/kotlin-springboot-petstore-all.sh b/bin/openapi3/kotlin-springboot-petstore-all.sh
new file mode 100755
index 0000000000..7aa4f697bb
--- /dev/null
+++ b/bin/openapi3/kotlin-springboot-petstore-all.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+./bin/openapi3/kotlin-springboot-petstore-server.sh
+./bin/openapi3/kotlin-springboot-petstore-server-reactive.sh
diff --git a/bin/openapi3/kotlin-springboot-petstore-server-reactive.sh b/bin/openapi3/kotlin-springboot-petstore-server-reactive.sh
new file mode 100755
index 0000000000..8c0d80c4e5
--- /dev/null
+++ b/bin/openapi3/kotlin-springboot-petstore-server-reactive.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+SCRIPT="$0"
+echo "# START SCRIPT: $SCRIPT"
+
+while [ -h "$SCRIPT" ] ; do
+ ls=$(ls -ld "$SCRIPT")
+ link=$(expr "$ls" : '.*-> \(.*\)$')
+ if expr "$link" : '/.*' > /dev/null; then
+ SCRIPT="$link"
+ else
+ SCRIPT=$(dirname "$SCRIPT")/"$link"
+ fi
+done
+
+if [ ! -d "${APP_DIR}" ]; then
+ APP_DIR=$(dirname "$SCRIPT")/..
+ APP_DIR=$(cd "${APP_DIR}"; pwd)
+fi
+
+executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
+
+if [ ! -f "$executable" ]
+then
+ mvn clean package
+fi
+
+export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
+ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/openapi3/petstore/kotlin-springboot-reactive --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,reactive=true"
+
+echo "Cleaning previously generated files if any from samples/server/openapi3/petstore/kotlin-springboot-reactive"
+rm -rf samples/server/openapi3/petstore/kotlin-springboot-reactive
+
+echo "Generating Kotling Spring Boot server..."
+java $JAVA_OPTS -jar $executable $ags
diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md
index 29f53a6c1e..0c4898f801 100644
--- a/docs/generators/kotlin-spring.md
+++ b/docs/generators/kotlin-spring.md
@@ -20,10 +20,11 @@ sidebar_label: kotlin-spring
|serverPort|configuration the port in which the sever is to run on| |8080|
|modelPackage|model package for generated code| |org.openapitools.model|
|apiPackage|api package for generated code| |org.openapitools.api|
-|exceptionHandler|generate default global exception handlers| |true|
+|exceptionHandler|generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )| |true|
|gradleBuildFile|generate a gradle build file using the Kotlin DSL| |true|
|swaggerAnnotations|generate swagger annotations to go alongside controllers and models| |false|
|serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false|
|serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false|
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
+|reactive|use coroutines for reactive behavior| |false|
|library|library template (sub-template)|
- **spring-boot**
- Spring-boot Server application.
|spring-boot|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
index 96cc499810..0c82615449 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
@@ -4707,7 +4707,7 @@ public class DefaultCodegen implements CodegenConfig {
codegenParameter.items = codegenProperty.items;
codegenParameter.mostInnerItems = codegenProperty.mostInnerItems;
codegenParameter.dataType = getTypeDeclaration(arraySchema);
- codegenParameter.baseType = getSchemaType(arraySchema);
+ codegenParameter.baseType = getSchemaType(inner);
codegenParameter.isContainer = Boolean.TRUE;
codegenParameter.isListContainer = Boolean.TRUE;
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java
index f142091531..8ac3ea459a 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java
@@ -60,6 +60,8 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
public static final String SWAGGER_ANNOTATIONS = "swaggerAnnotations";
public static final String SERVICE_INTERFACE = "serviceInterface";
public static final String SERVICE_IMPLEMENTATION = "serviceImplementation";
+ public static final String REACTIVE = "reactive";
+
private String basePackage;
private String invokerPackage;
@@ -72,6 +74,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
private boolean swaggerAnnotations = false;
private boolean serviceInterface = false;
private boolean serviceImplementation = false;
+ private boolean reactive = false;
public KotlinSpringServerCodegen() {
super();
@@ -140,7 +143,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
addOption(SERVER_PORT, "configuration the port in which the sever is to run on", serverPort);
addOption(CodegenConstants.MODEL_PACKAGE, "model package for generated code", modelPackage);
addOption(CodegenConstants.API_PACKAGE, "api package for generated code", apiPackage);
- addSwitch(EXCEPTION_HANDLER, "generate default global exception handlers", exceptionHandler);
+ addSwitch(EXCEPTION_HANDLER, "generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )", exceptionHandler);
addSwitch(GRADLE_BUILD_FILE, "generate a gradle build file using the Kotlin DSL", gradleBuildFile);
addSwitch(SWAGGER_ANNOTATIONS, "generate swagger annotations to go alongside controllers and models", swaggerAnnotations);
addSwitch(SERVICE_INTERFACE, "generate service interfaces to go alongside controllers. In most " +
@@ -149,7 +152,7 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
addSwitch(SERVICE_IMPLEMENTATION, "generate stub service implementations that extends service " +
"interfaces. If this is set to true service interfaces will also be generated", serviceImplementation);
addSwitch(USE_BEANVALIDATION, "Use BeanValidation API annotations to validate data types", useBeanValidation);
-
+ addSwitch(REACTIVE, "use coroutines for reactive behavior", reactive);
supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
setLibrary(SPRING_BOOT);
@@ -240,6 +243,14 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
this.useBeanValidation = useBeanValidation;
}
+ public boolean isReactive() {
+ return reactive;
+ }
+
+ public void setReactive(boolean reactive) {
+ this.reactive = reactive;
+ }
+
@Override
public CodegenType getTag() {
return CodegenType.SERVER;
@@ -332,6 +343,14 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
}
writePropertyBack(USE_BEANVALIDATION, useBeanValidation);
+ if (additionalProperties.containsKey(REACTIVE) && library.equals(SPRING_BOOT)) {
+ this.setReactive(convertPropertyToBoolean(REACTIVE));
+ // spring webflux doesn't support @ControllerAdvice
+ this.setExceptionHandler(false);
+ }
+ writePropertyBack(REACTIVE, reactive);
+ writePropertyBack(EXCEPTION_HANDLER, exceptionHandler);
+
modelTemplateFiles.put("model.mustache", ".kt");
apiTemplateFiles.put("api.mustache", ".kt");
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache
index 83c84799b3..fcf43b083b 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache
@@ -14,7 +14,7 @@ import io.swagger.annotations.AuthorizationScope
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
-import org.springframework.stereotype.Controller
+
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestPart
import org.springframework.web.bind.annotation.RequestParam
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestHeader
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
{{#useBeanValidation}}
import org.springframework.validation.annotation.Validated
{{/useBeanValidation}}
@@ -39,10 +40,13 @@ import javax.validation.constraints.Pattern
import javax.validation.constraints.Size
{{/useBeanValidation}}
+{{#reactive}}
+import kotlinx.coroutines.flow.Flow;
+{{/reactive}}
import kotlin.collections.List
import kotlin.collections.Map
-@Controller
+@RestController
{{#useBeanValidation}}
@Validated
{{/useBeanValidation}}
@@ -68,12 +72,12 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v
value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}}]){{/swaggerAnnotations}}
@RequestMapping(
value = ["{{#lambda.escapeDoubleQuote}}{{path}}{{/lambda.escapeDoubleQuote}}"],{{#singleContentTypes}}{{#hasProduces}}
- produces = "{{{vendorExtensions.x-accepts}}}", {{/hasProduces}}{{#hasConsumes}}
+ produces = "{{{vendorExtensions.x-accepts}}}",{{/hasProduces}}{{#hasConsumes}}
consumes = "{{{vendorExtensions.x-contentType}}}",{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}
produces = [{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}], {{/hasProduces}}{{#hasConsumes}}
consumes = [{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}],{{/hasConsumes}}{{/singleContentTypes}}
method = [RequestMethod.{{httpMethod}}])
- fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}): ResponseEntity<{{>returnTypes}}> {
+ {{#reactive}}{{^isListContainer}}suspend {{/isListContainer}}{{/reactive}}fun {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}): ResponseEntity<{{>returnTypes}}> {
return {{>returnValue}}
}
{{/operation}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache
index c05599c7b0..9d51d6d8c0 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache
@@ -1 +1 @@
-{{#isBodyParam}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/swaggerAnnotations}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody {{paramName}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}
\ No newline at end of file
+{{#isBodyParam}}{{#swaggerAnnotations}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/swaggerAnnotations}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody {{paramName}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isListContainer}}{{>optionalDataType}}{{/isListContainer}}{{#isListContainer}}Flow<{{{baseType}}}>{{/isListContainer}}{{/reactive}}{{/isBodyParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache
index 571f0179fa..7c5a1991b4 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/buildGradleKts.mustache
@@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.3.RELEASE")
+ classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.0.M3")
}
}
@@ -23,18 +23,26 @@ tasks.withType {
}
plugins {
- val kotlinVersion = "1.2.60"
+ val kotlinVersion = "1.3.30"
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 "2.0.3.RELEASE"
+ id("org.springframework.boot") version "2.2.0.M3"
id("io.spring.dependency-management") version "1.0.5.RELEASE"
}
dependencies {
+ val kotlinxCoroutinesVersion="1.2.0"
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.jetbrains.kotlin:kotlin-reflect")
+{{^reactive}}
compile("org.springframework.boot:spring-boot-starter-web")
+{{/reactive}}
+{{#reactive}}
+ compile("org.springframework.boot:spring-boot-starter-webflux")
+ compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
+ compile("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion")
+{{/reactive}}
{{#swaggerAnnotations}}
compile("io.swagger:swagger-annotations:1.5.21")
{{/swaggerAnnotations}}
@@ -47,3 +55,9 @@ dependencies {
exclude(module = "junit")
}
}
+
+repositories {
+ mavenCentral()
+ maven { url = uri("https://repo.spring.io/snapshot") }
+ maven { url = uri("https://repo.spring.io/milestone") }
+}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache
index e552565e4a..bd65158500 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/pom.mustache
@@ -6,12 +6,13 @@
{{artifactId}}
{{artifactVersion}}
- 1.2.60
+ 1.3.30
+ 1.2.0
org.springframework.boot
spring-boot-starter-parent
- 2.0.3.RELEASE
+ 2.2.0.M3
${project.basedir}/src/main/kotlin
@@ -77,8 +78,26 @@
org.springframework.boot
+{{^reactive}}
spring-boot-starter-web
+{{/reactive}}
+{{#reactive}}
+ spring-boot-starter-webflux
+{{/reactive}}
+{{#reactive}}
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-core
+ ${kotlinx-coroutines.version}
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-reactor
+ ${kotlinx-coroutines.version}
+
+{{/reactive}}
+
{{#swaggerAnnotations}}
io.swagger
@@ -116,4 +135,34 @@
test
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/settingsGradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/settingsGradle.mustache
index b8fd6c4c41..290868e279 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/settingsGradle.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/settingsGradle.mustache
@@ -1 +1,15 @@
+pluginManagement {
+ repositories {
+ maven { url = uri("https://repo.spring.io/snapshot") }
+ maven { url = uri("https://repo.spring.io/milestone") }
+ gradlePluginPortal()
+ }
+ resolutionStrategy {
+ eachPlugin {
+ if (requested.id.id == "org.springframework.boot") {
+ useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
+ }
+ }
+ }
+}
rootProject.name = "{{artifactId}}"
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache
index 67d79cc198..498e0aab4f 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache
@@ -1 +1 @@
-{{#isMapContainer}}{{#reactive}}Mono<{{/reactive}}Map{{/reactive}}>{{/isMapContainer}}{{#isListContainer}}{{#reactive}}Flux{{/reactive}}{{^reactive}}List{{/reactive}}<{{{returnType}}}>{{/isListContainer}}{{^returnContainer}}{{#reactive}}Mono<{{{returnType}}}>{{/reactive}}{{^reactive}}{{{returnType}}}{{/reactive}}{{/returnContainer}}
\ No newline at end of file
+{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{#reactive}}Flow{{/reactive}}{{^reactive}}List{{/reactive}}<{{{returnType}}}>{{/isListContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache
index 12b073f700..e9abca8eba 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache
@@ -2,12 +2,14 @@ package {{package}}
{{#imports}}import {{import}}
{{/imports}}
-
+{{#reactive}}
+import kotlinx.coroutines.flow.Flow;
+{{/reactive}}
{{#operations}}
interface {{classname}}Service {
{{#operation}}
- fun {{operationId}}({{#allParams}}{{paramName}}: {{>optionalDataType}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{>returnTypes}}
+ {{#reactive}}{{^isListContainer}}suspend {{/isListContainer}}{{/reactive}}fun {{operationId}}({{#allParams}}{{paramName}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isListContainer}}{{>optionalDataType}}{{/isListContainer}}{{#isListContainer}}Flow<{{{baseType}}}>{{/isListContainer}}{{/reactive}}{{/isBodyParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{>returnTypes}}
{{/operation}}
}
{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/serviceImpl.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/serviceImpl.mustache
index 32e62866af..b110e81378 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/serviceImpl.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/serviceImpl.mustache
@@ -2,13 +2,16 @@ package {{package}}
{{#imports}}import {{import}}
{{/imports}}
+{{#reactive}}
+import kotlinx.coroutines.flow.Flow;
+{{/reactive}}
import org.springframework.stereotype.Service
@Service
{{#operations}}
class {{classname}}ServiceImpl : {{classname}}Service {
{{#operation}}
- override fun {{operationId}}({{#allParams}}{{paramName}}: {{>optionalDataType}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{>returnTypes}} {
+ override {{#reactive}}{{^isListContainer}}suspend {{/isListContainer}}{{/reactive}}fun {{operationId}}({{#allParams}}{{paramName}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isListContainer}}{{>optionalDataType}}{{/isListContainer}}{{#isListContainer}}Flow<{{{baseType}}}>{{/isListContainer}}{{/reactive}}{{/isBodyParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{>returnTypes}} {
TODO("Implement me")
}
{{/operation}}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
index 68c556e5b0..1a3634effc 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
@@ -53,7 +53,7 @@ public class JavaClientCodegenTest {
CodegenParameter codegenParameter1 = codegen.fromRequestBody(body1, new HashSet(), null);
Assert.assertEquals(codegenParameter1.description, "A list of ids");
Assert.assertEquals(codegenParameter1.dataType, "List");
- Assert.assertEquals(codegenParameter1.baseType, "List");
+ Assert.assertEquals(codegenParameter1.baseType, "String");
RequestBody body2 = new RequestBody();
body2.setDescription("A list of list of values");
@@ -73,7 +73,7 @@ public class JavaClientCodegenTest {
CodegenParameter codegenParameter3 = codegen.fromRequestBody(body3, new HashSet(), null);
Assert.assertEquals(codegenParameter3.description, "A list of points");
Assert.assertEquals(codegenParameter3.dataType, "List");
- Assert.assertEquals(codegenParameter3.baseType, "List");
+ Assert.assertEquals(codegenParameter3.baseType, "Point");
}
@Test
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java
index 339fc73c11..1f16ac4a75 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java
@@ -1104,7 +1104,7 @@ public class JavaModelTest {
.items(new Schema<>().$ref("#/components/schemas/Pet"));
Operation operation = new Operation()
.requestBody(new RequestBody()
- .content(new Content().addMediaType("application/json",
+ .content(new Content().addMediaType("application/json",
new MediaType().schema(testSchema))))
.responses(
new ApiResponses().addApiResponse("204", new ApiResponse()
@@ -1116,7 +1116,7 @@ public class JavaModelTest {
Assert.assertEquals(co.bodyParams.size(), 1);
CodegenParameter cp1 = co.bodyParams.get(0);
- Assert.assertEquals(cp1.baseType, "List");
+ Assert.assertEquals(cp1.baseType, "Pet");
Assert.assertEquals(cp1.dataType, "List");
Assert.assertTrue(cp1.isContainer);
Assert.assertTrue(cp1.isListContainer);
@@ -1138,7 +1138,7 @@ public class JavaModelTest {
Operation operation = new Operation().responses(
new ApiResponses().addApiResponse("200", new ApiResponse()
.description("Ok response")
- .content(new Content().addMediaType("application/json",
+ .content(new Content().addMediaType("application/json",
new MediaType().schema(testSchema)))));
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema()));
final DefaultCodegen codegen = new JavaClientCodegen();
@@ -1184,7 +1184,7 @@ public class JavaModelTest {
.items(new Schema<>().$ref("#/components/schemas/Pet")));
Operation operation = new Operation()
.requestBody(new RequestBody()
- .content(new Content().addMediaType("application/json",
+ .content(new Content().addMediaType("application/json",
new MediaType().schema(testSchema))))
.responses(
new ApiResponses().addApiResponse("204", new ApiResponse()
@@ -1222,7 +1222,7 @@ public class JavaModelTest {
Operation operation = new Operation().responses(
new ApiResponses().addApiResponse("200", new ApiResponse()
.description("Ok response")
- .content(new Content().addMediaType("application/json",
+ .content(new Content().addMediaType("application/json",
new MediaType().schema(testSchema)))));
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("Pet", new ObjectSchema().addProperties("name", new StringSchema()));
final DefaultCodegen codegen = new JavaClientCodegen();
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java
index 87847e16cf..c830cd29b9 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java
@@ -47,6 +47,7 @@ public class KotlinSpringServerCodegenTest {
codegen.setServiceInterface(true);
codegen.setServiceImplementation(true);
codegen.setUseBeanValidation(false);
+ codegen.setReactive(false);
codegen.processOpts();
Assert.assertEquals(codegen.modelPackage(), "xx.yyyyyyyy.model");
@@ -69,6 +70,8 @@ public class KotlinSpringServerCodegenTest {
Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.SERVICE_IMPLEMENTATION), true);
Assert.assertFalse(codegen.getUseBeanValidation());
Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.USE_BEANVALIDATION), false);
+ Assert.assertFalse(codegen.isReactive());
+ Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.REACTIVE), false);
}
@Test
@@ -84,6 +87,7 @@ public class KotlinSpringServerCodegenTest {
codegen.additionalProperties().put(KotlinSpringServerCodegen.SERVICE_INTERFACE, true);
codegen.additionalProperties().put(KotlinSpringServerCodegen.SERVICE_IMPLEMENTATION, true);
codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_BEANVALIDATION, false);
+ codegen.additionalProperties().put(KotlinSpringServerCodegen.REACTIVE, false);
codegen.processOpts();
final OpenAPI openAPI = new OpenAPI();
@@ -112,6 +116,8 @@ public class KotlinSpringServerCodegenTest {
Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.SERVICE_IMPLEMENTATION), true);
Assert.assertFalse(codegen.getUseBeanValidation());
Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.USE_BEANVALIDATION), false);
+ Assert.assertFalse(codegen.isReactive());
+ Assert.assertEquals(codegen.additionalProperties().get(KotlinSpringServerCodegen.REACTIVE), false);
}
@Test
diff --git a/samples/client/petstore/R/docs/UserApi.md b/samples/client/petstore/R/docs/UserApi.md
index 342a3b3b40..6b0b6bbef4 100644
--- a/samples/client/petstore/R/docs/UserApi.md
+++ b/samples/client/petstore/R/docs/UserApi.md
@@ -73,7 +73,7 @@ api.instance$CreateUsersWithArrayInput(var.body)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**User**](array.md)| List of user object |
+ **body** | [**User**](User.md)| List of user object |
### Return type
@@ -110,7 +110,7 @@ api.instance$CreateUsersWithListInput(var.body)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**User**](array.md)| List of user object |
+ **body** | [**User**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md
index 9a535e16a8..aedbf750cf 100644
--- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md
+++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md
@@ -115,7 +115,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -173,7 +173,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md
index 8d41e64c6b..729be604bd 100644
--- a/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md
+++ b/samples/client/petstore/csharp/OpenAPIClient/docs/UserApi.md
@@ -128,7 +128,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -194,7 +194,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/go/go-petstore/docs/UserApi.md b/samples/client/petstore/go/go-petstore/docs/UserApi.md
index ea19e0e716..3201e1771d 100644
--- a/samples/client/petstore/go/go-petstore/docs/UserApi.md
+++ b/samples/client/petstore/go/go-petstore/docs/UserApi.md
@@ -59,7 +59,7 @@ Creates list of users with given input array
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
-**body** | [**[]User**](array.md)| List of user object |
+**body** | [**[]User**](User.md)| List of user object |
### Return type
@@ -90,7 +90,7 @@ Creates list of users with given input array
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
-**body** | [**[]User**](array.md)| List of user object |
+**body** | [**[]User**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/google-api-client/docs/UserApi.md b/samples/client/petstore/java/google-api-client/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/google-api-client/docs/UserApi.md
+++ b/samples/client/petstore/java/google-api-client/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/jersey1/docs/UserApi.md b/samples/client/petstore/java/jersey1/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/jersey1/docs/UserApi.md
+++ b/samples/client/petstore/java/jersey1/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md
+++ b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/jersey2/docs/UserApi.md b/samples/client/petstore/java/jersey2/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/jersey2/docs/UserApi.md
+++ b/samples/client/petstore/java/jersey2/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md
index ca29da916a..7f906eed6d 100644
--- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md
+++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md
@@ -114,7 +114,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -173,7 +173,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md
index ca29da916a..7f906eed6d 100644
--- a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md
+++ b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md
@@ -114,7 +114,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -173,7 +173,7 @@ public class Example {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/rest-assured/docs/UserApi.md b/samples/client/petstore/java/rest-assured/docs/UserApi.md
index 5b581cb927..5f5a5dbd36 100644
--- a/samples/client/petstore/java/rest-assured/docs/UserApi.md
+++ b/samples/client/petstore/java/rest-assured/docs/UserApi.md
@@ -81,7 +81,7 @@ api.createUsersWithArrayInput()
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -121,7 +121,7 @@ api.createUsersWithListInput()
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/resteasy/docs/UserApi.md b/samples/client/petstore/java/resteasy/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/resteasy/docs/UserApi.md
+++ b/samples/client/petstore/java/resteasy/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md
+++ b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/resttemplate/docs/UserApi.md b/samples/client/petstore/java/resttemplate/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/resttemplate/docs/UserApi.md
+++ b/samples/client/petstore/java/resttemplate/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md
index 9ffe8a7c39..31354a3cf1 100644
--- a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md
+++ b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md
index 9ffe8a7c39..31354a3cf1 100644
--- a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md
+++ b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md
index 9ffe8a7c39..31354a3cf1 100644
--- a/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md
+++ b/samples/client/petstore/java/retrofit2-play26/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/retrofit2/docs/UserApi.md b/samples/client/petstore/java/retrofit2/docs/UserApi.md
index 9ffe8a7c39..31354a3cf1 100644
--- a/samples/client/petstore/java/retrofit2/docs/UserApi.md
+++ b/samples/client/petstore/java/retrofit2/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md
index 9ffe8a7c39..31354a3cf1 100644
--- a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md
+++ b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md
index 9ffe8a7c39..31354a3cf1 100644
--- a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md
+++ b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/vertx/docs/UserApi.md b/samples/client/petstore/java/vertx/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/vertx/docs/UserApi.md
+++ b/samples/client/petstore/java/vertx/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/java/webclient/docs/UserApi.md b/samples/client/petstore/java/webclient/docs/UserApi.md
index 9133d79c33..3baa2c50ea 100644
--- a/samples/client/petstore/java/webclient/docs/UserApi.md
+++ b/samples/client/petstore/java/webclient/docs/UserApi.md
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**List<User>**](List.md)| List of user object |
+ **body** | [**List<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/javascript-es6/docs/UserApi.md b/samples/client/petstore/javascript-es6/docs/UserApi.md
index 11b1a96e51..121ddbda66 100644
--- a/samples/client/petstore/javascript-es6/docs/UserApi.md
+++ b/samples/client/petstore/javascript-es6/docs/UserApi.md
@@ -87,7 +87,7 @@ apiInstance.createUsersWithArrayInput(body, (error, data, response) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
@@ -130,7 +130,7 @@ apiInstance.createUsersWithListInput(body, (error, data, response) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/javascript-es6/src/api/UserApi.js b/samples/client/petstore/javascript-es6/src/api/UserApi.js
index 9c6c64ff77..aba7b237e6 100644
--- a/samples/client/petstore/javascript-es6/src/api/UserApi.js
+++ b/samples/client/petstore/javascript-es6/src/api/UserApi.js
@@ -85,7 +85,7 @@ export default class UserApi {
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @param {module:api/UserApi~createUsersWithArrayInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
createUsersWithArrayInput(body, callback) {
@@ -125,7 +125,7 @@ export default class UserApi {
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @param {module:api/UserApi~createUsersWithListInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
createUsersWithListInput(body, callback) {
diff --git a/samples/client/petstore/javascript-promise-es6/docs/UserApi.md b/samples/client/petstore/javascript-promise-es6/docs/UserApi.md
index 4b3539b38f..47af6eedad 100644
--- a/samples/client/petstore/javascript-promise-es6/docs/UserApi.md
+++ b/samples/client/petstore/javascript-promise-es6/docs/UserApi.md
@@ -85,7 +85,7 @@ apiInstance.createUsersWithArrayInput(body).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
@@ -127,7 +127,7 @@ apiInstance.createUsersWithListInput(body).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js
index 5e3cde6ee0..4921080e94 100644
--- a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js
+++ b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js
@@ -84,7 +84,7 @@ export default class UserApi {
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
createUsersWithArrayInputWithHttpInfo(body) {
@@ -116,7 +116,7 @@ export default class UserApi {
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
createUsersWithArrayInput(body) {
@@ -129,7 +129,7 @@ export default class UserApi {
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
createUsersWithListInputWithHttpInfo(body) {
@@ -161,7 +161,7 @@ export default class UserApi {
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
createUsersWithListInput(body) {
diff --git a/samples/client/petstore/javascript-promise/docs/UserApi.md b/samples/client/petstore/javascript-promise/docs/UserApi.md
index f46f57e598..aedc1280ea 100644
--- a/samples/client/petstore/javascript-promise/docs/UserApi.md
+++ b/samples/client/petstore/javascript-promise/docs/UserApi.md
@@ -87,7 +87,7 @@ apiInstance.createUsersWithArrayInput(body).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
@@ -130,7 +130,7 @@ apiInstance.createUsersWithListInput(body).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js
index eba3f7d152..0dba65ff97 100644
--- a/samples/client/petstore/javascript-promise/src/api/UserApi.js
+++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js
@@ -99,7 +99,7 @@
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.createUsersWithArrayInputWithHttpInfo = function(body) {
@@ -133,7 +133,7 @@
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.createUsersWithArrayInput = function(body) {
@@ -146,7 +146,7 @@
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.createUsersWithListInputWithHttpInfo = function(body) {
@@ -180,7 +180,7 @@
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.createUsersWithListInput = function(body) {
diff --git a/samples/client/petstore/javascript/docs/UserApi.md b/samples/client/petstore/javascript/docs/UserApi.md
index 55bc1a7aae..d405c1b6d2 100644
--- a/samples/client/petstore/javascript/docs/UserApi.md
+++ b/samples/client/petstore/javascript/docs/UserApi.md
@@ -91,7 +91,7 @@ apiInstance.createUsersWithArrayInput(body, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
@@ -136,7 +136,7 @@ apiInstance.createUsersWithListInput(body, callback);
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**[User]**](Array.md)| List of user object |
+ **body** | [**[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js
index 10211feaab..bd4f5966d1 100644
--- a/samples/client/petstore/javascript/src/api/UserApi.js
+++ b/samples/client/petstore/javascript/src/api/UserApi.js
@@ -100,7 +100,7 @@
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @param {module:api/UserApi~createUsersWithArrayInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.createUsersWithArrayInput = function(body, callback) {
@@ -142,7 +142,7 @@
/**
* Creates list of users with given input array
- * @param {Array.} body List of user object
+ * @param {Array.} body List of user object
* @param {module:api/UserApi~createUsersWithListInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.createUsersWithListInput = function(body, callback) {
diff --git a/samples/client/petstore/kotlin-string/docs/UserApi.md b/samples/client/petstore/kotlin-string/docs/UserApi.md
index 9c6055a914..0f55f06bc6 100644
--- a/samples/client/petstore/kotlin-string/docs/UserApi.md
+++ b/samples/client/petstore/kotlin-string/docs/UserApi.md
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
+ **body** | [**kotlin.Array<User>**](User.md)| List of user object |
### Return type
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
+ **body** | [**kotlin.Array<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md
index 9c6055a914..0f55f06bc6 100644
--- a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md
+++ b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
+ **body** | [**kotlin.Array<User>**](User.md)| List of user object |
### Return type
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
+ **body** | [**kotlin.Array<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/kotlin/docs/UserApi.md b/samples/client/petstore/kotlin/docs/UserApi.md
index 9c6055a914..0f55f06bc6 100644
--- a/samples/client/petstore/kotlin/docs/UserApi.md
+++ b/samples/client/petstore/kotlin/docs/UserApi.md
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
+ **body** | [**kotlin.Array<User>**](User.md)| List of user object |
### Return type
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
+ **body** | [**kotlin.Array<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md
index 375bf0ce9f..7cb382f9c1 100644
--- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md
+++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md
@@ -88,7 +88,7 @@ $apiInstance = new OpenAPI\Client\Api\UserApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
-$body = array(new \OpenAPI\Client\Model\array()); // \OpenAPI\Client\Model\User[] | List of user object
+$body = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object
try {
$apiInstance->createUsersWithArrayInput($body);
@@ -103,7 +103,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**\OpenAPI\Client\Model\User[]**](../Model/array.md)| List of user object |
+ **body** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object |
### Return type
@@ -141,7 +141,7 @@ $apiInstance = new OpenAPI\Client\Api\UserApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
-$body = array(new \OpenAPI\Client\Model\array()); // \OpenAPI\Client\Model\User[] | List of user object
+$body = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object
try {
$apiInstance->createUsersWithListInput($body);
@@ -156,7 +156,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**\OpenAPI\Client\Model\User[]**](../Model/array.md)| List of user object |
+ **body** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/python-asyncio/docs/UserApi.md b/samples/client/petstore/python-asyncio/docs/UserApi.md
index fdc2c30df9..783bb991ce 100644
--- a/samples/client/petstore/python-asyncio/docs/UserApi.md
+++ b/samples/client/petstore/python-asyncio/docs/UserApi.md
@@ -83,7 +83,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-body = None # list[User] | List of user object
+body = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -96,7 +96,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](list.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -134,7 +134,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-body = None # list[User] | List of user object
+body = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -147,7 +147,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](list.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/python-tornado/docs/UserApi.md b/samples/client/petstore/python-tornado/docs/UserApi.md
index fdc2c30df9..783bb991ce 100644
--- a/samples/client/petstore/python-tornado/docs/UserApi.md
+++ b/samples/client/petstore/python-tornado/docs/UserApi.md
@@ -83,7 +83,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-body = None # list[User] | List of user object
+body = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -96,7 +96,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](list.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -134,7 +134,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-body = None # list[User] | List of user object
+body = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -147,7 +147,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](list.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md
index fdc2c30df9..783bb991ce 100644
--- a/samples/client/petstore/python/docs/UserApi.md
+++ b/samples/client/petstore/python/docs/UserApi.md
@@ -83,7 +83,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-body = None # list[User] | List of user object
+body = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -96,7 +96,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](list.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -134,7 +134,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-body = None # list[User] | List of user object
+body = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -147,7 +147,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**list[User]**](list.md)| List of user object |
+ **body** | [**list[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/client/petstore/ruby/docs/UserApi.md b/samples/client/petstore/ruby/docs/UserApi.md
index 1fa8d487e9..49a57ef584 100644
--- a/samples/client/petstore/ruby/docs/UserApi.md
+++ b/samples/client/petstore/ruby/docs/UserApi.md
@@ -74,7 +74,7 @@ Creates list of users with given input array
require 'petstore'
api_instance = Petstore::UserApi.new
-body = nil # Array | List of user object
+body = [Petstore::User.new] # Array | List of user object
begin
#Creates list of users with given input array
@@ -89,7 +89,7 @@ end
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Array<User>**](Array.md)| List of user object |
+ **body** | [**Array<User>**](User.md)| List of user object |
### Return type
@@ -118,7 +118,7 @@ Creates list of users with given input array
require 'petstore'
api_instance = Petstore::UserApi.new
-body = nil # Array | List of user object
+body = [Petstore::User.new] # Array | List of user object
begin
#Creates list of users with given input array
@@ -133,7 +133,7 @@ end
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **body** | [**Array<User>**](Array.md)| List of user object |
+ **body** | [**Array<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md
index 74b4b6122e..0784a16451 100644
--- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md
+++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/UserApi.md
@@ -88,7 +88,7 @@ $apiInstance = new OpenAPI\Client\Api\UserApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
-$user = array(new \OpenAPI\Client\Model\array()); // \OpenAPI\Client\Model\User[] | List of user object
+$user = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object
try {
$apiInstance->createUsersWithArrayInput($user);
@@ -103,7 +103,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**\OpenAPI\Client\Model\User[]**](../Model/array.md)| List of user object |
+ **user** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object |
### Return type
@@ -141,7 +141,7 @@ $apiInstance = new OpenAPI\Client\Api\UserApi(
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
-$user = array(new \OpenAPI\Client\Model\array()); // \OpenAPI\Client\Model\User[] | List of user object
+$user = array(new \OpenAPI\Client\Model\User()); // \OpenAPI\Client\Model\User[] | List of user object
try {
$apiInstance->createUsersWithListInput($user);
@@ -156,7 +156,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**\OpenAPI\Client\Model\User[]**](../Model/array.md)| List of user object |
+ **user** | [**\OpenAPI\Client\Model\User[]**](../Model/User.md)| List of user object |
### Return type
diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python/docs/UserApi.md
index f8a548bd65..0003f88505 100644
--- a/samples/openapi3/client/petstore/python/docs/UserApi.md
+++ b/samples/openapi3/client/petstore/python/docs/UserApi.md
@@ -83,7 +83,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-user = None # list[User] | List of user object
+user = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -96,7 +96,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**list[User]**](list.md)| List of user object |
+ **user** | [**list[User]**](User.md)| List of user object |
### Return type
@@ -134,7 +134,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
-user = None # list[User] | List of user object
+user = [petstore_api.User()] # list[User] | List of user object
try:
# Creates list of users with given input array
@@ -147,7 +147,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**list[User]**](list.md)| List of user object |
+ **user** | [**list[User]**](User.md)| List of user object |
### Return type
diff --git a/samples/openapi3/client/petstore/ruby/docs/UserApi.md b/samples/openapi3/client/petstore/ruby/docs/UserApi.md
index e3e5506552..631a65ef1f 100644
--- a/samples/openapi3/client/petstore/ruby/docs/UserApi.md
+++ b/samples/openapi3/client/petstore/ruby/docs/UserApi.md
@@ -74,7 +74,7 @@ Creates list of users with given input array
require 'petstore'
api_instance = Petstore::UserApi.new
-user = nil # Array | List of user object
+user = [Petstore::User.new] # Array | List of user object
begin
#Creates list of users with given input array
@@ -89,7 +89,7 @@ end
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**Array<User>**](Array.md)| List of user object |
+ **user** | [**Array<User>**](User.md)| List of user object |
### Return type
@@ -118,7 +118,7 @@ Creates list of users with given input array
require 'petstore'
api_instance = Petstore::UserApi.new
-user = nil # Array | List of user object
+user = [Petstore::User.new] # Array | List of user object
begin
#Creates list of users with given input array
@@ -133,7 +133,7 @@ end
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **user** | [**Array<User>**](Array.md)| List of user object |
+ **user** | [**Array<User>**](User.md)| List of user object |
### Return type
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator-ignore b/samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator-ignore
new file mode 100644
index 0000000000..7484ee590a
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION
new file mode 100644
index 0000000000..06b5019af3
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION
@@ -0,0 +1 @@
+4.0.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/README.md b/samples/server/openapi3/petstore/kotlin-springboot-reactive/README.md
new file mode 100644
index 0000000000..b6865a0811
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/README.md
@@ -0,0 +1,21 @@
+# openAPIPetstore
+
+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).
+
+## Getting Started
+
+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.
+
+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).
+
+To build the project using maven, run:
+```bash
+mvn package && java -jar target/openapi-spring-1.0.0.jar
+```
+
+To build the project using gradle, run:
+```bash
+gradle build && java -jar build/libs/openapi-spring-1.0.0.jar
+```
+
+If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/)
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/build.gradle.kts b/samples/server/openapi3/petstore/kotlin-springboot-reactive/build.gradle.kts
new file mode 100644
index 0000000000..f62d3f33c8
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/build.gradle.kts
@@ -0,0 +1,55 @@
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
+buildscript {
+ repositories {
+ jcenter()
+ mavenCentral()
+ }
+ dependencies {
+ classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.0.M3")
+ }
+}
+
+group = "org.openapitools"
+version = "1.0.0"
+
+repositories {
+ jcenter()
+ mavenCentral()
+}
+
+tasks.withType {
+ kotlinOptions.jvmTarget = "1.8"
+}
+
+plugins {
+ val kotlinVersion = "1.3.30"
+ 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 "2.2.0.M3"
+ id("io.spring.dependency-management") version "1.0.5.RELEASE"
+}
+
+dependencies {
+ val kotlinxCoroutinesVersion="1.2.0"
+ compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
+ compile("org.jetbrains.kotlin:kotlin-reflect")
+ compile("org.springframework.boot:spring-boot-starter-webflux")
+ compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
+ compile("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion")
+ compile("io.swagger:swagger-annotations:1.5.21")
+ compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
+ compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
+ compile("com.fasterxml.jackson.module:jackson-module-kotlin")
+
+ testCompile("org.springframework.boot:spring-boot-starter-test") {
+ exclude(module = "junit")
+ }
+}
+
+repositories {
+ mavenCentral()
+ maven { url = uri("https://repo.spring.io/snapshot") }
+ maven { url = uri("https://repo.spring.io/milestone") }
+}
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/pom.xml b/samples/server/openapi3/petstore/kotlin-springboot-reactive/pom.xml
new file mode 100644
index 0000000000..1932017d4b
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/pom.xml
@@ -0,0 +1,151 @@
+
+ 4.0.0
+ org.openapitools
+ openapi-spring
+ jar
+ openapi-spring
+ 1.0.0
+
+ 1.3.30
+ 1.2.0
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.2.0.M3
+
+
+ ${project.basedir}/src/main/kotlin
+ ${project.basedir}/src/test/kotlin
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ repackage
+
+
+
+
+
+ kotlin-maven-plugin
+ org.jetbrains.kotlin
+ ${kotlin.version}
+
+
+ spring
+
+ 1.8
+
+
+
+ compile
+ compile
+
+ compile
+
+
+
+ test-compile
+ test-compile
+
+ test-compile
+
+
+
+
+
+ org.jetbrains.kotlin
+ kotlin-maven-allopen
+ ${kotlin.version}
+
+
+
+
+
+
+
+ org.jetbrains.kotlin
+ kotlin-stdlib-jdk8
+ ${kotlin.version}
+
+
+ org.jetbrains.kotlin
+ kotlin-reflect
+ ${kotlin.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-webflux
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-core
+ ${kotlinx-coroutines.version}
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-reactor
+ ${kotlinx-coroutines.version}
+
+
+
+ io.swagger
+ swagger-annotations
+ 1.5.21
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+ com.fasterxml.jackson.module
+ jackson-module-kotlin
+
+
+
+ javax.validation
+ validation-api
+
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+
+
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/settings.gradle b/samples/server/openapi3/petstore/kotlin-springboot-reactive/settings.gradle
new file mode 100644
index 0000000000..e9bd5d32d7
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/settings.gradle
@@ -0,0 +1,15 @@
+pluginManagement {
+ repositories {
+ maven { url = uri("https://repo.spring.io/snapshot") }
+ maven { url = uri("https://repo.spring.io/milestone") }
+ gradlePluginPortal()
+ }
+ resolutionStrategy {
+ eachPlugin {
+ if (requested.id.id == "org.springframework.boot") {
+ useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
+ }
+ }
+ }
+}
+rootProject.name = "openapi-spring"
\ No newline at end of file
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/Application.kt b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/Application.kt
new file mode 100644
index 0000000000..f2ee49d476
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/Application.kt
@@ -0,0 +1,14 @@
+package org.openapitools
+
+import org.springframework.boot.runApplication
+import org.springframework.context.annotation.ComponentScan
+import org.springframework.boot.autoconfigure.SpringBootApplication
+
+
+@SpringBootApplication
+@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"])
+class Application
+
+fun main(args: Array) {
+ runApplication(*args)
+}
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt
new file mode 100644
index 0000000000..29de43b1a0
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt
@@ -0,0 +1,186 @@
+package org.openapitools.api
+
+import org.openapitools.model.ModelApiResponse
+import org.openapitools.model.Pet
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
+import io.swagger.annotations.ApiResponse
+import io.swagger.annotations.ApiResponses
+import io.swagger.annotations.Authorization
+import io.swagger.annotations.AuthorizationScope
+import org.springframework.http.HttpStatus
+import org.springframework.http.MediaType
+import org.springframework.http.ResponseEntity
+
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RequestPart
+import org.springframework.web.bind.annotation.RequestParam
+import org.springframework.web.bind.annotation.PathVariable
+import org.springframework.web.bind.annotation.RequestHeader
+import org.springframework.web.bind.annotation.RequestMethod
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.context.request.NativeWebRequest
+import org.springframework.beans.factory.annotation.Autowired
+
+import javax.validation.Valid
+import javax.validation.constraints.DecimalMax
+import javax.validation.constraints.DecimalMin
+import javax.validation.constraints.Max
+import javax.validation.constraints.Min
+import javax.validation.constraints.NotNull
+import javax.validation.constraints.Pattern
+import javax.validation.constraints.Size
+
+import kotlinx.coroutines.flow.Flow;
+import kotlin.collections.List
+import kotlin.collections.Map
+
+@RestController
+@Validated
+@Api(value = "Pet", description = "The Pet API")
+@RequestMapping("\${api.base-path:/v2}")
+class PetApiController(@Autowired(required = true) val service: PetApiService) {
+
+ @ApiOperation(
+ value = "Add a new pet to the store",
+ nickname = "addPet",
+ notes = "",
+ authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
+ @ApiResponses(
+ value = [ApiResponse(code = 405, message = "Invalid input")])
+ @RequestMapping(
+ value = ["/pet"],
+ consumes = ["application/json", "application/xml"],
+ method = [RequestMethod.POST])
+ suspend fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet
+): ResponseEntity {
+ return ResponseEntity(service.addPet(pet), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "Deletes a pet",
+ nickname = "deletePet",
+ notes = "",
+ authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
+ @ApiResponses(
+ value = [ApiResponse(code = 400, message = "Invalid pet value")])
+ @RequestMapping(
+ value = ["/pet/{petId}"],
+ method = [RequestMethod.DELETE])
+ suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: Long
+,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: String?
+): ResponseEntity {
+ return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "Finds Pets by status",
+ nickname = "findPetsByStatus",
+ notes = "Multiple status values can be provided with comma separated strings",
+ response = Pet::class,
+ responseContainer = "List",
+ authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])])
+ @ApiResponses(
+ value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")])
+ @RequestMapping(
+ value = ["/pet/findByStatus"],
+ produces = ["application/xml", "application/json"],
+ method = [RequestMethod.GET])
+ fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: List
+): ResponseEntity> {
+ return ResponseEntity(service.findPetsByStatus(status), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "Finds Pets by tags",
+ nickname = "findPetsByTags",
+ notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
+ response = Pet::class,
+ responseContainer = "List",
+ authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])])
+ @ApiResponses(
+ value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")])
+ @RequestMapping(
+ value = ["/pet/findByTags"],
+ produces = ["application/xml", "application/json"],
+ method = [RequestMethod.GET])
+ fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: List
+,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: Int?
+): ResponseEntity> {
+ return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "Find pet by ID",
+ nickname = "getPetById",
+ notes = "Returns a single pet",
+ response = Pet::class,
+ authorizations = [Authorization(value = "api_key")])
+ @ApiResponses(
+ value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")])
+ @RequestMapping(
+ value = ["/pet/{petId}"],
+ produces = ["application/xml", "application/json"],
+ method = [RequestMethod.GET])
+ suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: Long
+): ResponseEntity {
+ return ResponseEntity(service.getPetById(petId), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "Update an existing pet",
+ nickname = "updatePet",
+ notes = "",
+ authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
+ @ApiResponses(
+ value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")])
+ @RequestMapping(
+ value = ["/pet"],
+ consumes = ["application/json", "application/xml"],
+ method = [RequestMethod.PUT])
+ suspend fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet
+): ResponseEntity {
+ return ResponseEntity(service.updatePet(pet), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "Updates a pet in the store with form data",
+ nickname = "updatePetWithForm",
+ notes = "",
+ authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
+ @ApiResponses(
+ value = [ApiResponse(code = 405, message = "Invalid input")])
+ @RequestMapping(
+ value = ["/pet/{petId}"],
+ consumes = ["application/x-www-form-urlencoded"],
+ method = [RequestMethod.POST])
+ suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: Long
+,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: String?
+,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: String?
+): ResponseEntity {
+ return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "uploads an image",
+ nickname = "uploadFile",
+ notes = "",
+ response = ModelApiResponse::class,
+ authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
+ @ApiResponses(
+ value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)])
+ @RequestMapping(
+ value = ["/pet/{petId}/uploadImage"],
+ produces = ["application/json"],
+ consumes = ["multipart/form-data"],
+ method = [RequestMethod.POST])
+ suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: Long
+,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: String?
+,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource?
+): ResponseEntity {
+ return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.OK)
+ }
+}
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt
new file mode 100644
index 0000000000..2bd53b2a56
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt
@@ -0,0 +1,23 @@
+package org.openapitools.api
+
+import org.openapitools.model.ModelApiResponse
+import org.openapitools.model.Pet
+import kotlinx.coroutines.flow.Flow;
+interface PetApiService {
+
+ suspend fun addPet(pet: Pet): Unit
+
+ suspend fun deletePet(petId: Long, apiKey: String?): Unit
+
+ fun findPetsByStatus(status: List): Flow
+
+ fun findPetsByTags(tags: List, maxCount: Int?): Flow
+
+ suspend fun getPetById(petId: Long): Pet
+
+ suspend fun updatePet(pet: Pet): Unit
+
+ suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit
+
+ suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse
+}
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt
new file mode 100644
index 0000000000..009f039d86
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt
@@ -0,0 +1,41 @@
+package org.openapitools.api
+
+import org.openapitools.model.ModelApiResponse
+import org.openapitools.model.Pet
+import kotlinx.coroutines.flow.Flow;
+import org.springframework.stereotype.Service
+@Service
+class PetApiServiceImpl : PetApiService {
+
+ override suspend fun addPet(pet: Pet): Unit {
+ TODO("Implement me")
+ }
+
+ override suspend fun deletePet(petId: Long, apiKey: String?): Unit {
+ TODO("Implement me")
+ }
+
+ override fun findPetsByStatus(status: List): Flow {
+ TODO("Implement me")
+ }
+
+ override fun findPetsByTags(tags: List, maxCount: Int?): Flow {
+ TODO("Implement me")
+ }
+
+ override suspend fun getPetById(petId: Long): Pet {
+ TODO("Implement me")
+ }
+
+ override suspend fun updatePet(pet: Pet): Unit {
+ TODO("Implement me")
+ }
+
+ override suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit {
+ TODO("Implement me")
+ }
+
+ override suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
+ TODO("Implement me")
+ }
+}
diff --git a/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt
new file mode 100644
index 0000000000..2ee42a7723
--- /dev/null
+++ b/samples/server/openapi3/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt
@@ -0,0 +1,109 @@
+package org.openapitools.api
+
+import org.openapitools.model.Order
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
+import io.swagger.annotations.ApiResponse
+import io.swagger.annotations.ApiResponses
+import io.swagger.annotations.Authorization
+import io.swagger.annotations.AuthorizationScope
+import org.springframework.http.HttpStatus
+import org.springframework.http.MediaType
+import org.springframework.http.ResponseEntity
+
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RequestPart
+import org.springframework.web.bind.annotation.RequestParam
+import org.springframework.web.bind.annotation.PathVariable
+import org.springframework.web.bind.annotation.RequestHeader
+import org.springframework.web.bind.annotation.RequestMethod
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.context.request.NativeWebRequest
+import org.springframework.beans.factory.annotation.Autowired
+
+import javax.validation.Valid
+import javax.validation.constraints.DecimalMax
+import javax.validation.constraints.DecimalMin
+import javax.validation.constraints.Max
+import javax.validation.constraints.Min
+import javax.validation.constraints.NotNull
+import javax.validation.constraints.Pattern
+import javax.validation.constraints.Size
+
+import kotlinx.coroutines.flow.Flow;
+import kotlin.collections.List
+import kotlin.collections.Map
+
+@RestController
+@Validated
+@Api(value = "Store", description = "The Store API")
+@RequestMapping("\${api.base-path:/v2}")
+class StoreApiController(@Autowired(required = true) val service: StoreApiService) {
+
+ @ApiOperation(
+ value = "Delete purchase order by ID",
+ nickname = "deleteOrder",
+ notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors")
+ @ApiResponses(
+ value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")])
+ @RequestMapping(
+ value = ["/store/order/{orderId}"],
+ method = [RequestMethod.DELETE])
+ suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: String
+): ResponseEntity {
+ return ResponseEntity(service.deleteOrder(orderId), HttpStatus.OK)
+ }
+
+ @ApiOperation(
+ value = "Returns pet inventories by status",
+ nickname = "getInventory",
+ notes = "Returns a map of status codes to quantities",
+ response = Int::class,
+ responseContainer = "Map",
+ authorizations = [Authorization(value = "api_key")])
+ @ApiResponses(
+ value = [ApiResponse(code = 200, message = "successful operation", response = Map::class, responseContainer = "Map")])
+ @RequestMapping(
+ value = ["/store/inventory"],
+ produces = ["application/json"],
+ method = [RequestMethod.GET])
+ suspend fun getInventory(): ResponseEntity