admin管理员组文章数量:1312895
In our project, we generate controllers with OpenAPI generator. In one of those controllers, there's an endpoint with a path variable, on which I need to put our custom annotation @Encrypted
, like below:
@RequestMapping(
method = RequestMethod.GET,
value = "/notification/{id}/download",
produces = { "application/pdf", "application/json" }
)
ResponseEntity<.springframework.core.io.Resource> downloadNotification(
@Size(max = 255) @PathVariable("id") @Encrypted String id
);
and this is specification. I tried x-field-extra-annotation
:
/notification/{id}/download:
get:
parameters:
- name: id
schema:
maxLength: 255
type: string
in: path
required: true
x-field-extra-annotation: "@sbbol.annotation.Encrypted"
However, OpenAPI ignores it, and I get an endpoint without my annotation:
ResponseEntity<.springframework.core.io.Resource> downloadNotification(
@Size(max = 255) @PathVariable("id") String id
);
Is there a way to put a custom annotation on a path variable in OpenAPI?
本文标签: javaHow to put a custom annotation on path variable in openApiStack Overflow
版权声明:本文标题:java - How to put a custom annotation on path variable in openApi - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741836296a2400235.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论