From 0c8b808f7bddd5caf077bfc094a117b5a1a6fab1 Mon Sep 17 00:00:00 2001 From: Patrick ALLAIN Date: Wed, 26 Aug 2020 17:09:42 +0200 Subject: [PATCH] Use yaml config files introduce in #6509 to manage samples (#2901) --- bin/configs/java-feign-no-nullable.yaml | 11 +++++ .../java-play-framework-no-nullable.yaml | 7 ++++ bin/configs/java-vertx-no-nullable.yaml | 9 +++++ ...pring-boot-beanvalidation-no-nullable.yaml | 11 +++++ bin/configs/spring-cloud-no-nullable.yaml | 10 +++++ bin/configs/spring-mvc-no-nullable.yaml | 10 +++++ bin/java-petstore-all.sh | 0 bin/java-petstore-feign-no-nullable.sh | 40 ------------------- bin/java-petstore-vertx-no-nullable.sh | 35 ---------------- ...java-play-framework-petstore-server-all.sh | 0 ...y-framework-petstore-server-no-nullable.sh | 34 ---------------- bin/spring-all-petstore.sh | 0 ...spring-cloud-feign-petstore-no-nullable.sh | 35 ---------------- bin/spring-mvc-petstore-no-nullable.sh | 33 --------------- ...store-server-beanvalidation-no-nullable.sh | 35 ---------------- 15 files changed, 58 insertions(+), 212 deletions(-) create mode 100644 bin/configs/java-feign-no-nullable.yaml create mode 100644 bin/configs/java-play-framework-no-nullable.yaml create mode 100644 bin/configs/java-vertx-no-nullable.yaml create mode 100644 bin/configs/spring-boot-beanvalidation-no-nullable.yaml create mode 100644 bin/configs/spring-cloud-no-nullable.yaml create mode 100644 bin/configs/spring-mvc-no-nullable.yaml delete mode 100755 bin/java-petstore-all.sh delete mode 100755 bin/java-petstore-feign-no-nullable.sh delete mode 100755 bin/java-petstore-vertx-no-nullable.sh delete mode 100755 bin/java-play-framework-petstore-server-all.sh delete mode 100755 bin/java-play-framework-petstore-server-no-nullable.sh delete mode 100755 bin/spring-all-petstore.sh delete mode 100755 bin/spring-cloud-feign-petstore-no-nullable.sh delete mode 100755 bin/spring-mvc-petstore-no-nullable.sh delete mode 100755 bin/springboot-petstore-server-beanvalidation-no-nullable.sh diff --git a/bin/configs/java-feign-no-nullable.yaml b/bin/configs/java-feign-no-nullable.yaml new file mode 100644 index 000000000000..05453b419dcf --- /dev/null +++ b/bin/configs/java-feign-no-nullable.yaml @@ -0,0 +1,11 @@ +generatorName: java +outputDir: samples/client/petstore/java/feign-no-nullable +library: feign +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + booleanGetterPrefix: is + artifactId: petstore-feign-no-nullable + hideGenerationTimestamp: "true" + additionalModelTypeAnnotations: '@javax.annotation.concurrent.Immutable' + openApiNullable: "false" diff --git a/bin/configs/java-play-framework-no-nullable.yaml b/bin/configs/java-play-framework-no-nullable.yaml new file mode 100644 index 000000000000..3eaf7366c2ae --- /dev/null +++ b/bin/configs/java-play-framework-no-nullable.yaml @@ -0,0 +1,7 @@ +generatorName: java-play-framework +outputDir: samples/server/petstore/java-play-framework-no-nullable +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaPlayFramework +additionalProperties: + hideGenerationTimestamp: "true" + openApiNullable: "false" diff --git a/bin/configs/java-vertx-no-nullable.yaml b/bin/configs/java-vertx-no-nullable.yaml new file mode 100644 index 000000000000..1282bdfae711 --- /dev/null +++ b/bin/configs/java-vertx-no-nullable.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/vertx-no-nullable +library: vertx +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-vertx-no-nullable + hideGenerationTimestamp: "true" + openApiNullable: "false" diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml new file mode 100644 index 000000000000..85c687f4978b --- /dev/null +++ b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml @@ -0,0 +1,11 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-beanvalidation-no-nullable +library: spring-boot +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + java8: "false" + useBeanValidation: true + artifactId: spring-boot-beanvalidation-no-nullable + hideGenerationTimestamp: "true" + openApiNullable: "false" diff --git a/bin/configs/spring-cloud-no-nullable.yaml b/bin/configs/spring-cloud-no-nullable.yaml new file mode 100644 index 000000000000..74d487b947ad --- /dev/null +++ b/bin/configs/spring-cloud-no-nullable.yaml @@ -0,0 +1,10 @@ +generatorName: spring +outputDir: samples/client/petstore/spring-cloud-no-nullable +library: spring-cloud +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud +additionalProperties: + artifactId: petstore-spring-cloud-no-nullable + responseWrapper: HystrixCommand + hideGenerationTimestamp: "true" + openApiNullable: "false" diff --git a/bin/configs/spring-mvc-no-nullable.yaml b/bin/configs/spring-mvc-no-nullable.yaml new file mode 100644 index 000000000000..f1d6585071c5 --- /dev/null +++ b/bin/configs/spring-mvc-no-nullable.yaml @@ -0,0 +1,10 @@ +generatorName: spring +outputDir: samples/server/petstore/spring-mvc-no-nullable +library: spring-mvc +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: spring-mvc-server-no-nullable + openApiNullable: "false" + serverPort: "8002" + hideGenerationTimestamp: "true" diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/bin/java-petstore-feign-no-nullable.sh b/bin/java-petstore-feign-no-nullable.sh deleted file mode 100755 index 522cc91469f5..000000000000 --- a/bin/java-petstore-feign-no-nullable.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/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 -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/feign -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-feign-9x.json -o samples/client/petstore/java/feign-no-nullable --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is,additionalModelTypeAnnotations=@javax.annotation.concurrent.Immutable,openApiNullable=false $@" - -echo "Removing files and folders under samples/client/petstore/java/feign-no-nullable/src/main" -rm -rf samples/client/petstore/java/feign-no-nullable/src/main -find samples/client/petstore/java/feign-no-nullable -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags - -# copy additional manually written unit-tests -mkdir samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client - -cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/StringUtilTest.java diff --git a/bin/java-petstore-vertx-no-nullable.sh b/bin/java-petstore-vertx-no-nullable.sh deleted file mode 100755 index 519a09b024c9..000000000000 --- a/bin/java-petstore-vertx-no-nullable.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/vertx -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-vertx.json -o samples/client/petstore/java/vertx-no-nullable --additional-properties hideGenerationTimestamp=true --additional-properties openApiNullable=false $@" - -echo "Removing files and folders under samples/client/petstore/java/vertx-no-nullable/src/main" -rm -rf samples/client/petstore/java/vertx-no-nullable/src/main -find samples/client/petstore/java/vertx-no-nullable -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-play-framework-petstore-server-all.sh b/bin/java-play-framework-petstore-server-all.sh deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/bin/java-play-framework-petstore-server-no-nullable.sh b/bin/java-play-framework-petstore-server-no-nullable.sh deleted file mode 100755 index 861ef42ee057..000000000000 --- a/bin/java-play-framework-petstore-server-no-nullable.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/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 -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaPlayFramework -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g java-play-framework -o samples/server/petstore/java-play-framework-no-nullable --additional-properties hideGenerationTimestamp=true,openApiNullable=false $@" - -java $JAVA_OPTS -jar $executable $ags - -cp CI/samples.ci/server/petstore/java-play-framework/pom.xml samples/server/petstore/java-play-framework-no-nullable/pom.xml diff --git a/bin/spring-all-petstore.sh b/bin/spring-all-petstore.sh deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/bin/spring-cloud-feign-petstore-no-nullable.sh b/bin/spring-cloud-feign-petstore-no-nullable.sh deleted file mode 100755 index 9b8e60a21034..000000000000 --- a/bin/spring-cloud-feign-petstore-no-nullable.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g spring -c bin/spring-cloud-feign-petstore.json -o samples/client/petstore/spring-cloud-no-nullable --additional-properties hideGenerationTimestamp=true,responseWrapper=HystrixCommand,openApiNullable=false $@" - -echo "Removing files and folders under samples/client/petstore/spring-cloud-no-nullable/src/main" -rm -rf samples/client/petstore/spring-cloud-no-nullable/src/main -find samples/client/petstore/spring-cloud-no-nullable -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/spring-mvc-petstore-no-nullable.sh b/bin/spring-mvc-petstore-no-nullable.sh deleted file mode 100755 index a421fc758e23..000000000000 --- a/bin/spring-mvc-petstore-no-nullable.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/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 -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -c bin/spring-mvc-petstore-server.json -o samples/server/petstore/spring-mvc-no-nullable --additional-properties hideGenerationTimestamp=true,java8=false --additional-properties serverPort=8002 --additional-properties booleanGetterPrefix=get --additional-properties openApiNullable=false $@" - -java $JAVA_OPTS -jar $executable $ags - diff --git a/bin/springboot-petstore-server-beanvalidation-no-nullable.sh b/bin/springboot-petstore-server-beanvalidation-no-nullable.sh deleted file mode 100755 index c38a1f43752e..000000000000 --- a/bin/springboot-petstore-server-beanvalidation-no-nullable.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot-beanvalidation-no-nullable -c bin/springboot-petstore-server-beanvalidation.json --additional-properties hideGenerationTimestamp=true,java8=false,openApiNullable=false $@" - -echo "Removing files and folders under samples/server/petstore/springboot-beanvalidation-no-nullable/src/main" -rm -rf samples/server/petstore/springboot-beanvalidation-no-nullable/src/main -find samples/server/petstore/springboot-beanvalidation-no-nullable -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags