title: How to force a DTO class to be in Swagger models
body: <p>I have a SpringBoot application with Swagger 3.17.1.</p>
  
  <p>I have one abstract class <code>AbstractDtoClass</code> and one DTO class <code>DtoClass</code> that extends the first one.</p>
  
  <p>I have several REST request definitions, and all returns a <code>AbstractDtoClass</code> object, none returns <code>DtoClass</code>.</p>
  
  <p>As a result, the Swagger models, i.e. the DTO models I can find in "definitions" from /v2/api-docs, contains <code>AbstractDtoClass</code> but not <code>DtoClass</code>.</p>
  
  <p>I would like <code>DtoClass</code> to be in the Swagger models too. How can I do that?</p>
  
  <p>I have tried to put <code>@SwaggerDefinition</code> on the <code>DtoClass</code> definition.<br/>
  I have tried to put <code>@ApiModel(parent = AbstractDtoClass.class)</code> on the <code>DtoClass</code> definition.<br/>
  I have tried to put <code>@ApiModel(subTypes = {DeclarationDto.class}, discriminator = "DeclarationDto")</code> on the <code>AbstractDtoClass</code> definition even though I am not sure I am using discriminator properly.</p>
  
  <p>Nothing have worked.</p>
  
  <p>Can anyone help me please?</p>