使用 jar 文件时,Micronaut openapi 页面为空白
Micronaut openapi page is blank when using jar file
我将 micronaut 与 Kotlin 结合使用,Gradle 与 Kotlin DSL 结合使用。
启用 OpenAPI,当 运行 来自 Intellij 的应用程序时工作正常。但是当启动 JAR 时,我在打开时得到一个空白页面,例如:
http://localhost:8080/swagger/views/redoc
不是 404 而是 200,只是一个空白页面 - 没有内容传输到浏览器。
使用此编译器参数:
kapt {
arguments {
arg(
"micronaut.openapi.views.spec",
"-Dmicronaut.openapi.views.spec=rapidoc.enabled=true,swagger-ui.enabled=true,swagger-ui.theme=flattop"
)
}
}
有人知道吗?
好的,我知道了。这是一个使用问题。需要打开:
http://localhost:8080/swagger/views/redoc/index.html
如果有人知道如何将 index.html 设置为默认值,我很高兴 ;-)
我将 micronaut 与 Kotlin 结合使用,Gradle 与 Kotlin DSL 结合使用。
启用 OpenAPI,当 运行 来自 Intellij 的应用程序时工作正常。但是当启动 JAR 时,我在打开时得到一个空白页面,例如:
http://localhost:8080/swagger/views/redoc
不是 404 而是 200,只是一个空白页面 - 没有内容传输到浏览器。
使用此编译器参数:
kapt {
arguments {
arg(
"micronaut.openapi.views.spec",
"-Dmicronaut.openapi.views.spec=rapidoc.enabled=true,swagger-ui.enabled=true,swagger-ui.theme=flattop"
)
}
}
有人知道吗?
好的,我知道了。这是一个使用问题。需要打开:
http://localhost:8080/swagger/views/redoc/index.html
如果有人知道如何将 index.html 设置为默认值,我很高兴 ;-)