【发布时间】:2020-06-25 14:27:04
【问题描述】:
我有几个控制器类都需要标头参数。为了记录招摇我将这个 @Parameter 注释添加到我的所有端点:
@Parameter(in = ParameterIn.HEADER, description = "some description", name = "some name", content = @Content(schema = @Schema(allowableValues = {VALUE1, VALUE2, VALUE3, VALUE4})))
@GetMapping
public void method(@RequestHeader .....) {
//some code here
}
问题是我不喜欢在控制器方法中重复相同的注释。这里有一个很好的干净的解决方案来有一个可重用的注释吗?
【问题讨论】:
标签: java spring-boot swagger