Closed jonaskahn closed 1 month ago
Don't think the issue is on the *
. We need to isolate the offending mapping/function
I still think it's a bug. I do create a fresh start project This will lead program to an error when maven run
class App: Kooby({
install(NettyServer())
install(OpenAPIModule())
mvc(Controller_())
get("/api/*") {
ctx.forward("/")
}
})
fun main(args: Array<String>) {
runApp(args, ::App)
}
If I change to get(/api/)
, it will work.
class App: Kooby({
install(NettyServer())
install(OpenAPIModule())
mvc(Controller_())
get("/api/") {
ctx.forward("/")
}
})
fun main(args: Array<String>) {
runApp(args, ::App)
}
with script/lambda routes the open api parser expect to find the parameter in source code, so:
get("/some/*") {
val value = ctx.path("*").value()
...
}
Works, while this one won't:
get("/some/*") {
// never retrieve the *
ctx.forward("/")
}
That is the bug
I created project from jooby command cli with openapi. From the beginning, it worked pretty well, after I made some change. I can't generate OPEN API , it always throw error
Failed to execute goal io.jooby:jooby-maven-plugin:3.2.6:openapi (default) on project api: execution of openapi resulted in exception: Kotlin lambda not found: io/jooby/kt/Kooby.<init>(Lkotlin/jvm/functions/Function1;)V -> [Help 1]
Could you point me out which's wrong? Here is my pom setting
UPDATE 1
I guess I found the reason why. So I used anonymous object to group routes like
I change to declare a specific class like
And now, it lead me to another error
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because the return value of "io.jooby.internal.openapi.OperationExt.getParameters()" is null at io.jooby.internal.openapi.OperationExt.getParameter (OperationExt.java:138) at io.jooby.openapi.OpenAPIGenerator.generate (OpenAPIGenerator.java:211)
UPDATE 2
I found the reason for the error above, I guess we have some conflictions
I tried to used static files that built in vuejs. So, To tell vuejs handle menu link I delcare some routes like belove
These line break the maven build, if I remove
get
line. It works.get
method controller. If I inject context to this. It's also dead.UPDATE 3. I come closer to the issue
*
break the maven build openapi. If I remove*
inget
path. Thing work normally, but I think it should be considered as a bug ?