Skip to content

Commit a6b35f5

Browse files
committed
fix(kotlin-spring): use correct Jackson 3 property path for WRITE_DATES_AS_TIMESTAMPS
When using Spring Boot 4 with Jackson 3, the property path for WRITE_DATES_AS_TIMESTAMPS changed from: spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS to: spring.jackson.datatype.datetime.WRITE_DATES_AS_TIMESTAMPS This fix adds conditional logic to the kotlin-spring generator template to use the correct property path based on useSpringBoot4 flag, matching the behavior already implemented in the JavaSpring generator. Fixes binding error: 'Failed to bind properties under spring.jackson.serialization to java.util.Map<tools.jackson.databind.SerializationFeature, java.lang.Boolean>: No enum constant tools.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS'
1 parent 0659b25 commit a6b35f5

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-boot/application.mustache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ spring:
33
name: {{title}}
44

55
jackson:
6+
{{#useSpringBoot4}}
7+
datatype:
8+
datetime:
9+
WRITE_DATES_AS_TIMESTAMPS: false
10+
{{/useSpringBoot4}}
11+
{{^useSpringBoot4}}
612
serialization:
713
WRITE_DATES_AS_TIMESTAMPS: false
14+
{{/useSpringBoot4}}
815

916
server:
1017
port: {{serverPort}}

samples/server/petstore/kotlin-springboot-4/src/main/resources/application.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ spring:
33
name: openAPIPetstore
44

55
jackson:
6-
serialization:
7-
WRITE_DATES_AS_TIMESTAMPS: false
6+
datatype:
7+
datetime:
8+
WRITE_DATES_AS_TIMESTAMPS: false
89

910
server:
1011
port: 8080

0 commit comments

Comments
 (0)