【发布时间】:2020-10-22 20:08:32
【问题描述】:
我正在尝试将 Additional Properties 元素设置到 Open API Schema 3.X 中,但不幸的是,我无法在文档中找到任何可以帮助我的内容。 我在 Spring Boot 中有一个应用程序,它使用依赖 Swagger OAS 作为传递依赖的 Spring doc OAS。 让我在这里挑选一些代码 sn-p:
@GetMapping("/{accountId}")
@Operation(summary = "Get account by account id", tags = TAG)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Return a specific account queried by path",
content = { @Content(mediaType = "application/json",
schema = @Schema(implementation = AccountDetailsDTO.class)) }),
@ApiResponse(responseCode = "404", description = "No accounts found",
content = @Content) })
public ResponseEntity<AccountDetailsDTO> getAccountDetailsByClientId(@PathVariable("accountId") Integer accountId) { }
【问题讨论】:
标签: java spring spring-boot swagger openapi