OpenAPI Generator's Kotlin client generator now supports multiplatform

https://news.ycombinator.com/item?id=21089885
by wing328hk • 7 years ago
1 0 7 years ago

We've added multiplatform (https://kotlinlang.org/docs/reference/multiplatform.html) support to the Kotlin client generator in the OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) project. To generate a Kotlin API client with multiplatform support given an OpenAPI/Swagger specification file (https://github.com/OAI/OpenAPI-Specification), please follow 3 simple steps below:

1. Download the Java JAR (https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.3-SNAPSHOT/openapi-generator-cli-4.1.3-20190927.041122-45.jar)

2. Rename the JAR as "openapi-generator-cli.jar"

3. Run the following command to generate a Nim API client for the Petstore API (https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml):

Mac/Linux:

$ java -jar openapi-generator-cli.jar generate -g kotlin -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml --library multiplatform -o /var/tmp/kotlin/

Windows:

$ java -jar openapi-generator-cli.jar generate -g kotlin -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml --library multiplatform -o C:\tmp\kotlin

If you've any feedback or question, please let us know via https://github.com/OpenAPITools/openapi-generator/issues/new

Thanks for the enhancement by Andrew Emery (https://github.com/andrewemery)

Ref: https://github.com/OpenAPITools/openapi-generator/pull/3900

Related Stories

Loading related stories...

Source preview

news.ycombinator.com