Created by: andrewemery
Support for the generation of Kotlin Multiplatform clients.
Background
The kotlin
language defined in the Swagger Codegen project currently generates a Kotlin client that can run on the JVM. Somewhat recently, JetBrains introduced Kotlin Multiplatform, a platform that provides the ability to share code between various platforms: JVM, JS, iOS, Windows, etc. This pull request adds the ability to generate a Kotlin Multiplatform client.
Library
The pull request includes Kotlin Multiplatform generation under the kotlin
language and introduces two library options:
-
jvm
: (default) to target the existing Kotlin JVM generation. -
multiplatform
: to target Kotlin Multiplatform generation.
Limitations
The current pull request only currently adds support for JVM and iOS platforms but support for other platforms should be trivial to add.
At present, date
and date-time
objects are rendered as strings. No attempt is made to integrate any third-party date/time libraries.
Tests
The current implementation doesn't include any tests beyond those already included as part of the kotlin
language implementation. A test project can be found here that generates the petstore
sample and includes tests to verify the correctness of the implementation.
Comments welcome.
References
https://github.com/OpenAPITools/openapi-generator/issues/3899 https://github.com/andrewemery/openapi-generator-kotlin-multiplatform-petstore