i am not able to get ISO formatted dates.
Setup:
- Kotlin 1.7.10
- Spring Boot 2.7.1
- Jackson 2.13.3
with following jackson dependencies:
- jackson-module-kotlin
- jackson-databind
Application properties
spring:
jackson:
date-format: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
default-property-inclusion: non_null
serialization:
write-dates-as-timestamps: false
INDENT_OUTPUT: true
deserialization:
FAIL_ON_UNKNOWN_PROPERTIES: false
FAIL_ON_INVALID_SUBTYPE: false
I also tried moving this config to class level but no difference.
It only works when i use property annotations like:
@JsonProperty("startTimestamp")
@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
var startTimestamp: LocalDateTime
But that's not an option.
Edit
I also tried:
- Overriding the default configuration of ObjectMapper
- Customizing the ObjectMapper using Jackson2ObjectMapperBuilderCustomizer