Reputation: 25802
In my Spring Boot application I use a following DTO with @RestController
:
public abstract class ComparableQuery extends BaseQuery {
private final Object value;
...
}
Everything works fine but when I use Spring RestTemplate
and pass java.util.Date
as ComparableQuery.value
I see that Jackson serialize the date object into the following "magic" number:
"value":1009836000000
Right now I don't understand how the date object serialized into the 1009836000000
number representation and how to emulate it when I use for example AngularJS as a client of my back-end API. Please advise.
Upvotes: 1
Views: 1961
Reputation: 34024
This is a very similar problem as described in this answer about null
handling with jackson and spring boot.
The corresponding configuration for date formatting in application.properties
should look like:
spring.jackson.write-dates-as-timestamps=false
Upvotes: 2