I use swagger to test my rest api, one of the properties of my entity class is a date field for which I need a date in the format yyyy-mm-dd, but the swagger model diagram shows this field as date- instead of a date field, so it gives a date with time and zone. How can I convert this date field to a date field?
I have a Java TimeEntry.java entity class, one of its properties is Date, it looks like this.
@ApiModelProperty(required = true)
@JsonFormat(pattern = DATE_FORMAT)
private Date date;
for this field, in the swagger user interface model diagram, the field date is displayed as "date": "2016-01-08T22: 34: 22.337Z", but I need it as "date": "2016-01-08".
I tried the following:
1.
@ApiModelProperty(required = true, dataType="date")
@JsonFormat(pattern = DATE_FORMAT)
private Date date;
2. ( OverrideConvertor), swagger-core 1.3 version mvn repo. 1.5 https://github.com/swagger-api/swagger-core/wiki/overriding-models
- -, 1.5 OverrideConvertor
https://groups.google.com/forum/#!topic/swagger-swaggersocket/ChiknyHZiP4
, .