Skip to content

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

Merged
wing328 merged 16 commits into
OpenAPITools:masterfrom
Wooyme:kotlin-vertx
Sep 14, 2019
Merged

[Kotlin][server] Add kotlin-vertx-server#3031
wing328 merged 16 commits into
OpenAPITools:masterfrom
Wooyme:kotlin-vertx

Conversation

@Wooyme

Copy link
Copy Markdown
Contributor

Description of the PR

add vertx server for kotlin

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wing328

Copy link
Copy Markdown
Member

Thanks for the PR.

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

@wing328

Copy link
Copy Markdown
Member

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

@wing328wing328 modified the milestones: 4.0.3, 4.1.0Jul 9, 2019
@wing328wing328 modified the milestones: 4.1.0, 4.1.1Aug 9, 2019
@jimschubert

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

@wing328

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

fixed it

@wing328

Copy link
Copy Markdown
Member

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

@wing328wing328 modified the milestones: 4.1.1, 4.1.2Aug 26, 2019
@wing328wing328 modified the milestones: 4.1.2, 4.1.3Sep 11, 2019
@wing328
wing328 merged commit 87dce1b into OpenAPITools:masterSep 14, 2019
@wing328

Copy link
Copy Markdown
Member

@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 freeto 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

@Wooyme@wing328@jimschubert