I'm puzzled as to why using a default inclusion of jackson that Spring seems to have customised the default Jackson configuration.
One setting it's messing with is WRITE_DATES_AS_TIMESTAMPS
, the Jackson default is true
however Spring has somewhere changed this to false
and also provided a date format.
Where in the world is this happening? I want my dates to remain serialised as numbers.
UPDATE: Turns out it's not spring that's causing the problem, it's actually hibernates proxy classes causing the problem. For some reason if hibernate has a type-mapping of type="date"
it serialises as a date string, though if its type="timestamp"
it serialises as expected. Rather than spend too much time looking into this I've decided to just change all my mappings to timestamp for now.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…