У меня есть много dto, которые уже описаны @ApiModel и @ApiModelProperty аннотации чванства.
Вот объекты dto.
Первое.
@Data
@ApiModel
public class CompleteUserTaskDTO {
private static final Logger LOGGER = LoggerFactory.getLogger(CompleteUserTaskDTO.class);
@NotNull(message = "error.user_task_complete_parameters_not_null")
@ApiModelProperty(notes = "description")
private Object parameters;
public Object toDTO(Class<?> clz) {
try {
ObjectMapper mapper = new ObjectMapper();
return mapper.convertValue(this.parameters, clz);
}catch (Exception ex) {
LOGGER.error("The parameters field value convert to the class -- {} instance failed. The parameters values are -- {}. ", clz.getName(), this.parameters);
throw ex;
}
}
}
Второй.
@Data
@ApiModel
public class FirstApprovalCompleteVariableDTO {
@NotNull(message = "error.task.first_approval.first_approve_result_not_null")
@ApiModelProperty(notes = "description")
private FirstApprovalResult firstApprovalResult;
@ApiModelProperty(notes = "description")
private Set<Long> extraInfoIds;
@ApiModelProperty(notes = "description")
private Set<Long> reUploadApplicationMaterialFileIds;
}
Вот модели Swagger UI.Но приведенная выше структура объекта и описание не включены в модели.
![enter image description here](https://i.stack.imgur.com/J15Tj.png)
Я хочу, чтобы свагер сканировал dto, отображенный аннотацией @ApiModel, и отображал их намодели Swagger UI.
Может кто-нибудь сказать мне, как это сделать?Спасибо вам всем.