I have the following in my model as described in https://stackoverflow.com/a/34750537/148844
@ApiModelProperty(required = true, dataType = "java.time.LocalDate")
@JsonFormat(pattern="yyyy-MM-dd")
private Date mCreatedAt;
However Swagger is still displaying the date as a date-time-with-zone. I also tried org.joda.time.LocalDate
. How do I change the documentation date format example?
Here is the documentation on the property.
SpringFox-Swagger-UI 2.9.2
I noticed this error at top of Swagger UI when run.
Errors
Resolver error at paths./getTrackingDataByUserID.post.responses.200.schema.properties.items.items.properties.mCreatedAt.$ref
Could not resolve reference because of: Could not resolve pointer: /definitions/LocalDate does not exist in document
Best Answer
You need to use
java.sql.Date
instead ofjava.time.LocalDate
. If you interested in what is mapped to what checkspringfox.documentation.schema.Types
. Here is full example:,which will generate the following:
Here is relevant content of
springfox.documentation.schema.Types
: