Micronaut-core: Document how to change Jackson LocalDateTime serialization

Created on 31 May 2018  路  3Comments  路  Source: micronaut-projects/micronaut-core

How can I configure Jackson using micronaut to output dates as yyyy-MM-dd'T'HH:mm:ss.SSSZ date format? I tried something like this:

@JacksonFeatures(
        enabledSerializationFeatures = {},
        disabledSerializationFeatures = {SerializationFeature.WRITE_DATES_AS_TIMESTAMPS},
        enabledDeserializationFeatures = {}
)
public class Application {

    public static void main(String[] args) {
        Micronaut.run(Application.class);
    }
}
docs

Most helpful comment

@akozel This should work. The docs are missing a bunch of the features around configuration. I'll work on adding them.

jackson:
    serialization:
        writeDatesAsTimestamps: false

All 3 comments

@akozel This should work. The docs are missing a bunch of the features around configuration. I'll work on adding them.

jackson:
    serialization:
        writeDatesAsTimestamps: false

This works for me. thank you.

Was this page helpful?
0 / 5 - 0 ratings