【发布时间】:2021-01-21 06:23:23
【问题描述】:
我正在尝试在 api 调用中添加授权标头,请您告诉如何使用 open api swagger doc 进行配置。
代码:
@Bean
public OpenAPI customOpenAPI(@Value("${application-description}") String appDesciption, @Value("${application-version}") String appVersion) {
return new OpenAPI()
.info(new Info()
.title("Access Management APIs")
.version("1.0")
.description("Access Management APIs for tp db")
.termsOfService("http://swagger.io/terms/")
.license(new License().name("Apache 2.0").url("http://springdoc.org")));
}
控制器类:
@PutMapping(value = "/{aNumber}",
produces = APPLICATION_JSON_VALUE)
public ResponseEntity<Object> updateSubsidyAward(@Valid @RequestBody UpdateAwardDetailsRequest awardUpdateRequest,
@PathVariable("aNumber") Long aNumber)
{
}
【问题讨论】:
标签: swagger swagger-ui