【发布时间】:2021-01-15 04:50:21
【问题描述】:
我正在尝试在 micronaut 招摇 UI 中合并附加文件架构。我认为该文件在构建期间没有被拾取,不太确定如何为附加文件设置正确的路径。
在资源内部存在附加文件
在 application.yml 配置中我设置了以下配置
micronaut:
openapi:
additional:
files= src/main/resources/swagger/swaggerSecuritySchemes.yml
swaggerSecuritySchemes.yml
securitySchemes:
Open Id Connect:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://falconidentityserver.azurewebsites.net/connect/authorize
tokenUrl: https://falconidentityserver.azurewebsites.net/connect/token
refreshUrl: ""
scopes:
openid: Open Id scope
profile: Name scope
email: Email scope
usePkceWithAuthorizationCodeGrant: true
在build swagger yml文件中,那些配置不存在,我认为在构建过程中没有选择文件,我们如何设置附加文件的路径
来自 micronaut 文档
micronaut.openapi.additional.files={project.home}/src/test/resources/swagger
project.home 是什么?
我在 build.gradle 文件中尝试了以下代码,但它没有合并其他文件中的任何内容
tasks.withType(JavaCompile).all {
options.fork = true
options.forkOptions.jvmArgs << '-Dmicronaut.openapi.views.spec=swagger-ui.enabled=true,swagger-ui.theme=MATERIAL'
options.forkOptions.jvmArgs << '-Dmicronaut.openapi.additional.files=src/main/resources/swagger'
options.compilerArgs += ['--enable-preview']
}
更新 1
components:
securitySchemes:
Open Id Connect:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://falconidentityserver.azurewebsites.net/connect/authorize
tokenUrl: https://falconidentityserver.azurewebsites.net/connect/token
refreshUrl: ""
clientId: xxxxxxxxxx
clientSecret: xxxxx-xxxxxxxxxxxxx
scopes:
openid: Open Id scope
profile: Name scope
email: Email scope
usePkceWithAuthorizationCodeGrant: true
包括上面的定义合并了配置,但是在最终文档中clientId、clientSecret和usePkceWithAuthorizationCodeGrant没有合并,为什么? p>
【问题讨论】:
标签: java swagger swagger-ui micronaut micronaut-client