ApiModelProperty Annotation of objects not working with swagger

Viewed 1466

swagger version 1.5.20

 public class SomeDto extends TemporallyScopedEntityDto {

    @ApiModelProperty(value="This DOES NOT display in swagger ui docs")
    private ZonedDateTimeDto publishDate;

    @ApiModelProperty(value="This DOES display in swagger ui docs")
    private List<CodeTypeDto> territories = new ArrayList<>();
}

Both annotations appear in the api-docs json file

However publish Date does not appear in the swagger docs UI

Territories does appear in the swagger docs UI

Is there a reason why the java object cannot be annotated like this Model

1 Answers

Unfortunately Swagger does not really support adding description to nested fields. See the last section of this link to get some background information about it.

Related