Commit 80d4c32
authored
fix(kotlin-spring): use correct Jackson 3 property path for WRITE_DATES_AS_TIMESTAMPS (#23384)
* 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'
* test(kotlin-spring): add tests for Jackson datetime property path
Add tests to verify that:
- Spring Boot 4 generates application.yaml with spring.jackson.datatype.datetime.WRITE_DATES_AS_TIMESTAMPS
- Spring Boot 3 generates application.yaml with spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS1 parent e1c4fdb commit 80d4c32
3 files changed
Lines changed: 57 additions & 2 deletions
File tree
- modules/openapi-generator/src
- main/resources/kotlin-spring/libraries/spring-boot
- test/java/org/openapitools/codegen/kotlin/spring
- samples/server/petstore/kotlin-springboot-4/src/main/resources
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
679 | 726 | | |
680 | 727 | | |
681 | 728 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
0 commit comments