mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 02:55:19 +00:00
8689227b3e
* Kotlin Spring initial bootstrap * Basic configuration construction for Kotlin Spring * Wired up with comand line client * Initial kotlin spring boot application generated using gradle kotlin-dsl * Added basic support for generating models * Basic controllers generated without endpoints generated * Basic spring boot app generated with models and controllers * Added fix for type mapping in AbstractKotlinCodegen. Originally it was mapping list o kotlin.Array instead of kotlin.collections.List * Fixed return type mapping * Sorted bash springboot petstore generator script * Implemented toVarName in AbstractKotlinCodegen to better handle some edgecases * Checking for reserved words or numerical starting class names in AbstractKotlinCodegen * Implemented toOperationId in AbstractKotlinCodegen * Fixed types that were not correctly being mapped to primitives (byte / arrayOf / mapOf) * Escaping dollar symbols in function names * Added support for outter enum classes * Added basic support for generating services * Removed option for generated config package. Added option to enable/disable generated global exception handler * Added configuration option to generate gradle. Generated maven pom.xml file as default * Fixed up bash scripts for generating test sample code * Added configurable option for Swagger Annotations * Added configurable option for generating service interfaces and service implementations * Added README generation * Enable optional bean validation * Added kotlin spring sample to CircleCI pom.xml * Removed kotlin spring boot from .gitignore * Minor fixes from PR comments for user submission (#1) * Minor fixes from PR comments for user submission * Puts braces around conditional block bodies with one-liner bodies. * Modifies README.mustache to use artifact id and version supplied by user (or default configuration) * Targets templates under resource directory explicitly to prevent the need to rebuild for evaluation of template-only changes. * [kotlin-spring] Remove comments referencing sbt in bash scripts * List of changes based upon code review: * Additional comments around how we set the title based off the open api spec * Fixed missing `beanValidationCore` template * Put the lambdas into the lambda object as other generators do (Ktor, C#, cpp) * Bump swagger-annotations version to latest pre-2.0 version (1.5.21) * Set kotlin version to 1.2.60 * Updated README to set port based on template * Added more additional properties to build bash scripts * Removed `defaultBasePath.mustache` in place of using {{contextPath}} directly * Log warning for when `serviceImplementation` is set t o true * Updated samples * Generating ConstraintViolation Exception Handler, as Springboot doesnt correctly catch the error and return bad request. Handling other exceptions a litle better * Small fix for date time mappings (plus sample re-gen) * Minor fix in README template, where port was using wrong variable * Fix missing jackson-dataformat-xml dependency * Fix build - needed to re-run kotlin-server-petstore.sh * Fixes after merge with master * Revert "Small fix for date time mappings (plus sample re-gen)" This reverts commit 4152dc78b4813da71c675272ca90fb31a333aea1. * Moved type mappings to Kotlin Spring generator * Regenerated samples * Regenerated samples
36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/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} -XX:MaxPermSize=256M -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 --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true"
|
|
|
|
echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot"
|
|
rm -rf samples/server/petstore/kotlin-springboot
|
|
|
|
echo "Generating Kotling Spring Boot server..."
|
|
java $JAVA_OPTS -jar $executable $ags
|