forked from loafle/openapi-generator-original
* [Kotlin-Spring] Support multiline descriptions This commit adds support for multiline descriptions for operations in the Kotlin-Spring generator, for both regular API generation (i.e. Controller), as well as interface-only API generation. Multiline descriptions allow us to use rich text representations, e.g. with Markdown. Note that Markdown-formatted descriptions are rendered nicely in Swagger-UI. I imagine that most openapi consumers will be able (or will want to) support Markdown (at some point). The solution for Kotlin-Spring is rather simple, using Raw Strings to contain the `unescapedNotes`. See: https://kotlinlang.org/docs/strings.html#raw-strings Note that specific unescaped strings could cause problems. For example, the string containing three double quotes `"""` would result in compile errors for the generated code. I think this is acceptable. Note that an improvement is possible to use `.trimMargin()` in combination with the pipe symbol `|`, to allow specific margin prefixing. Note that the description is used in escaped form in the JavaDoc. This could be resolved by prefixing every line of the unescapedNotes with a star `*`. For now, I've chosen to implement this the simplest way I could think off. Signed-off-by: Nico Korthout <nico.korthout@camunda.com> * [Kotlin-Spring] Update samples Signed-off-by: Nico Korthout <nico.korthout@camunda.com> --------- Signed-off-by: Nico Korthout <nico.korthout@camunda.com>
openAPIPetstore
This Kotlin based Spring Boot application has been generated using the 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
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.
To build the project using maven, run:
mvn package && java -jar target/openapi-spring-1.0.0.jar
To build the project using gradle, run:
gradle build && java -jar build/libs/openapi-spring-1.0.0.jar
If all builds successfully, the server should run on http://localhost:8080/