Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kotlin][server] Add kotlin-vertx-server #3031

Merged
merged 16 commits into from
Sep 14, 2019

Conversation

Wooyme
Copy link
Contributor

@Wooyme Wooyme commented May 30, 2019

Description of the PR

add vertx server for kotlin

@@ -0,0 +1,214 @@
package org.openapitools.codegen.languages;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wing328
Copy link
Member

wing328 commented May 30, 2019

Thanks for the PR.

Can you please ping me via https://gitter.im (ID: wing328) as I've some suggestions?

@wing328
Copy link
Member

wing328 commented Jun 28, 2019

cc Kotlin tech committee: @jimschubert (2017/09) @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04)

@wing328 wing328 modified the milestones: 4.0.3, 4.1.0 Jul 9, 2019
@wing328 wing328 modified the milestones: 4.1.0, 4.1.1 Aug 9, 2019
@jimschubert
Copy link
Member

Generated code doesn't seem to build.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.891 s
[INFO] Finished at: 2019-08-10T21:32:41-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project openapi-kotlin-vertx-server: Could not resolve dependencies for project org.openapitools:openapi-kotlin-vertx-server:jar:1.0.0-SNAPSHOT: Could not find artifact com.github.wooyme:vertx-openapi-router:jar:1.0.2 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

@Wooyme
Copy link
Contributor Author

Wooyme commented Aug 11, 2019

Sorry,I forgot upload 1.0.2 to maven central. It's ok now.

@wing328
Copy link
Member

wing328 commented Aug 13, 2019

I got errors when running mvn clean package in the auto-generated code:

[WARNING] Using experimental Kotlin incremental compilation
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (103, 24) Unresolved reference: status
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (107, 40) Unresolved reference: TypeToken
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (107, 57) Unresolved reference: List
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (107, 82) Unresolved reference: type
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (110, 39) Unresolved reference: JsonArray
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (121, 24) Unresolved reference: tags
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (125, 40) Unresolved reference: TypeToken
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (125, 57) Unresolved reference: List
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (125, 82) Unresolved reference: type
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (128, 39) Unresolved reference: JsonArray
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (195, 82) Unresolved reference: file
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt: (85, 24) Unresolved reference: body
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt: (89, 40) Unresolved reference: TypeToken
[ERROR] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt: (89, 57) Unresolved reference: List

Does it work for you locally in your machine?

@Wooyme
Copy link
Contributor Author

Wooyme commented Aug 14, 2019

fixed it

@wing328
Copy link
Member

wing328 commented Aug 20, 2019

Found some warnings:

[WARNING] Source root doesn't exist: /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/java
[WARNING] Using experimental Kotlin incremental compilation
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt: (15, 8) This class shouldn't be used in Kotlin. Use kotlin.collections.List or kotlin.collections.MutableList instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt: (16, 8) This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt: (56, 53) Unchecked cast: Any! to Map<String, Any>
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt: (56, 56) This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt: (42, 31) Parameter 'id' is never used
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApi.kt: (14, 8) This class shouldn't be used in Kotlin. Use kotlin.collections.List or kotlin.collections.MutableList instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApi.kt: (15, 8) This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApi.kt: (43, 53) Unchecked cast: Any! to Map<String, Any>
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApi.kt: (43, 56) This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/StoreApiVertxProxyHandler.kt: (41, 31) Parameter 'id' is never used
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApi.kt: (14, 8) This class shouldn't be used in Kotlin. Use kotlin.collections.List or kotlin.collections.MutableList instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApi.kt: (15, 8) This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApi.kt: (55, 53) Unchecked cast: Any! to Map<String, Any>
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApi.kt: (55, 56) This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
[WARNING] /Users/williamcheng/Code/openapi-generator/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/UserApiVertxProxyHandler.kt: (41, 31) Parameter 'id' is never used

@wing328 wing328 modified the milestones: 4.1.1, 4.1.2 Aug 26, 2019
@wing328 wing328 modified the milestones: 4.1.2, 4.1.3 Sep 11, 2019
@wing328 wing328 merged commit 87dce1b into OpenAPITools:master Sep 14, 2019
@wing328
Copy link
Member

wing328 commented Oct 4, 2019

@Wooyme thanks for the PR, which has been included in the v4.1.3 release: https://twitter.com/oas_generator/status/1180123829626003456

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants