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: mvc: don't generate primitive types with generics type #3490

Closed
jknack opened this issue Aug 3, 2024 · 0 comments
Closed

kotlin: mvc: don't generate primitive types with generics type #3490

jknack opened this issue Aug 3, 2024 · 0 comments

Comments

@jknack
Copy link
Member

jknack commented Aug 3, 2024

Given:

fun box(@QueryParam box: Box<Int>)

Generates:

 /** See [Controller.box] */
app.get("/box", this::box)
  .setReturnType(io.jooby.Reified.getParameterized(foo.Box::class.java, Int::class.java).getType())
  .setMvcMethod(Controller::class.java.getMethod("box", foo.Box::class.java))

Which results in a runtime exception:

[2024-08-03 11:57:40,773]-[main] ERROR io.jooby.Jooby - Application initialization resulted in exception
java.lang.IllegalArgumentException: Not a primitive type: int
        at jars//io.jooby.internal.reflect.$Types.checkNotPrimitive($Types.java:385)
        at jars//io.jooby.internal.reflect.$Types$ParameterizedTypeImpl.<init>($Types.java:429)
        at jars//io.jooby.internal.reflect.$Types.newParameterizedTypeWithOwner($Types.java:43)
        at jars//io.jooby.Reified.getParameterized(Reified.java:229)
        at kotlin-new-apt//app.Controller_.install(Controller_.kt:70)
        at jars//io.jooby.Jooby.mvc(Jooby.java:533)

@jknack jknack added this to the 3.2.8 milestone Aug 3, 2024
@jknack jknack closed this as completed in e1d12d1 Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant