I have Spring Boot controller and for easy API reference used Swagger.
Question about timestamp
. Why in generated documentation example looks like:
"timestamp": {
"date": 0,
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"time": 0,
"timezoneOffset": 0,
"year": 0
}
So why swagger have so strange example for timestamp no just simple numeric value, which standard describes this representation?
check open specification of Swagger (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md).
If you want to solve the issue, try this sample spring boot application
Demo Object
}
check below image or open http://localhost:8080/swagger-ui.html
.directModelSubstitute(Timestamp.class, Long.class)
is responsible of mapping between timestamp type and numeric type