如何使用micronaut在@openapidefinition上配置动态值
是否可以在@openapidefinition上具有动态值?
- Micronaut OpenAPI中的此设置当前正在工作,我们可以显示版本和服务器上下文路径:
在Application.Class:
中
@openapidefinition( info = @info(title =“ $ {info.title}”,description =“ $ {info.description}”,版本=“ $ {info.version}”),服务器= {@server(url =“ $ {” $ { server.context-path}”)}}
在Openapi.properties中
我的目标是:
- 我想使用“ micronaut.server.context-path” application.properties的值
如果我使用“ micronaut.server.context-path”,它只是将其视为字符串文字,而不是 - 我想从build-info.properties使用“ build.version”值的 不动产价值
我也想使用“ build.version”,但我没有如何在micronaut中引用该内容
Is it possible to have dynamic values on @OpenAPIDefinition?
- This setup in Micronaut openapi is currently working, we can display the version and server context-path:
In Application.class:@OpenAPIDefinition(
info = @Info(title = "${info.title}", description = "${info.description}",version ="${info.version}"), servers = {@Server(url ="${server.context-path}")}In openapi.properties
My objectives are:
- I want to use the "micronaut.server.context-path" value from application.properties
if I use "micronaut.server.context-path", it just take it as string literal, as is not the real property value - I want to use the "build.version" value from build-info.properties
I also want to use the "build.version", but I didn't how I can reference that in micronaut
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论