У меня есть DTO, аннотированный как модель API.Это DTO также имеет некоторые полезные функции.Я пытаюсь комментировать эти полезные функции.Аннотирование с помощью @ApiOperation
или @ApiModelProperty
не позволяет включить эту функцию в сгенерированный файл yaml.Как вы аннотируете такие методы в DTO?
@ApiModel(value = "Document information")
public class DocumentDto {
public enum DocumentType {
PDF,
WORD,
CSV
}
...
@NotNull
@ApiModelProperty(required = true, value = "document type", allowableValues = "PDF, WORD, CSV")
private DocumentType documentType;
...
@JsonIgnore
@ApiOperation(value = "is this document a PDF?")
public boolean isPDF() {
return documentType == DocumentType.PDF;
}
}