OpenAPITools / OpenAPITools/openapi-generator
[KOTLIN MULTIPLATFORM] Compilation errors related to Kotlinx.serialization
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
I am trying to use openapi-generator for a multiplatform project and I started with the petstore api as described in this reddit post. I am unable to run ./gradlew assemble on the multiplatform project and gettin some compilation errors which seems related to Kotlinx.serialization library. I have added the different artifacts and steps followed to reproduce this error.
openapi-generator version
openapi-jar-version: 5.0.1
openapi-jar : https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.1/openapi-generator-cli-5.0.1.jar
OpenAPI declaration file content or url
Command line used for generation
java -jar openapi-generator-cli.jar generate -g kotlin -i petstore.yaml --library multiplatform -o /var/tmp/kotlin/
Steps to reproduce
- Download openapi-generator-cli
- Download petstore.yaml
- Update
distributionUrlingradlew-wrapper.propertiestodistributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip - Update following version in
build.gradle
kotlin_version=1.4.30coroutines_version=1.3.1ktor_version=1.5.1kotlinx_version=1.1.0-rc
- run
./gradlew version
Related issues/PRs
stacktrace : https://gist.github.com/RahulRvR/cc4e8bc52373baa0862f125da888c09a
Suggest a fix/enhancement
- Could be related to the version of libraries (Kotlinx.serialization, ktor) used while generating the models. Is the possible to update the libraries before generating the code?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Kotlin multiplatform generator command and the generated project's build.gradle and gradlew-wrapper.properties. Run ./gradlew assemble using the reported Kotlin, coroutines, Ktor, and kotlinx.serialization versions, then inspect the linked stacktrace and compilation errors. Done means the generated petstore project compiles successfully with the documented dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100