I am trying to create a link for a response in OpenAPI 3.0 specification. More specifically, I want to provide a known relationship between one of my responses and other available operation (cf. Link Object).
In my Spring Boot project I am using Springdoc (version: 1.3.9) for the generation of my API documentation. According to the @ApiResponse#links documentation I have tried to achieve my goal with following code for the endpoint:
@GetMapping(value = "/avatar", produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Request avatar info", operationId = "requestAvatar")
@ResponseStatus(HttpStatus.OK)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", links = {
@Link(name = "Download Avatar", operationId = "downloadAvatar",
parameters = {
@LinkParameter(name = "userId"),
@LinkParameter(name = "uuid")
})
}),
...
@ResponseBody
ResponseEntity<Avatar> requestAvatar();
Unfortunately, I cannot see any results in the Swagger UI but "No links" description.
After checking the generated JSON specification I also didn't find any links key for the requestAvatar API.
Did I missed something during the creation of the @Link or does Springdoc not support the links yet?
