OpenAPITools / OpenAPITools/openapi-generator

[BUG] compilation issues with output from kotlin-vertx server generator

Open
#22,213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

output from kotlin-vertx won't compile in the latest master (vertx 4.x) and previous stable version (vertx 3.x).

[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[162,33] Unresolved reference: launch
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[162,46] Class 'kotlinx.coroutines.CoroutineDispatcher' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.6.0.
[ERROR] The class is loaded from C:/Users/User/.m2/repository/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.10.2/kotlinx-coroutines-core-jvm-1.10.2.jar!/kotlinx/coroutines/CoroutineDispatcher.class
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[163,46] Suspend function 'loginUser' should be called only from a coroutine or another suspend function
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[168,25] Unresolved reference: it
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[168,40] Unresolved reference: it
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[186,21] Class 'kotlinx.coroutines.GlobalScope' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.6.0.
[ERROR] The class is loaded from C:/Users/User/.m2/repository/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.10.2/kotlinx-coroutines-core-jvm-1.10.2.jar!/kotlinx/coroutines/GlobalScope.class
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[186,33] Unresolved reference: launch
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[186,46] Class 'kotlinx.coroutines.CoroutineDispatcher' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.6.0.
[ERROR] The class is loaded from C:/Users/User/.m2/repository/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.10.2/kotlinx-coroutines-core-jvm-1.10.2.jar!/kotlinx/coroutines/CoroutineDispatcher.class
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[187,46] Suspend function 'updateUser' should be called only from a coroutine or another suspend function
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[192,25] Unresolved reference: it
[ERROR] C:\Users\User\Code\openapi-generator2\samples\server\petstore\kotlin\vertx\src\main\kotlin\org\openapitools\server\api\verticle\UserApiVertxProxyHandler.kt:[192,40] Unresolved reference: it
[ERROR] -> [Help 1]
[ERROR]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by regenerating and compiling the Kotlin Vert.x Petstore sample, focusing on UserApiVertxProxyHandler.kt and the reported lines around launch, loginUser, and updateUser. Check the Kotlin and kotlinx.coroutines versions involved in the generated output; done means the sample compiles successfully for both Vert.x 4.x and 3.x.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.