I have a Spring Boot application with a REST API that returns the following object:
public class Response {
private DTO data;
private Error error;
}
DTO
is an abstract class for all DTOs:
public abstract class DTO { }
The subclass:
public class CountryDTO extends DTO {
private Long id;
private String code;
private String name;
}
pom.xml
:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
When I check the API documentation in Swagger UI, it does not show the details of the real DTO that I send as part of the response. Instead, Swagger UI just shows:
{
"data": {},
"error": {
"message": "string"
}
}
Is there a way to tell Swagger UI to show the correct the correct DTO JSON that I will return as part of this API?