我正在尝试将其他属性元素设置到 Open API Schema 3.X 中,但不幸的是我无法在文档中找到任何可以帮助我的内容。我在 Spring boot 中有一个应用程序,它使用 Spring doc OAS,该 OAS 依赖于 Swagger OAS 作为传递依赖项。让我在这里挑选一些代码片段:
@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) { }
Run Code Online (Sandbox Code Playgroud)