Skip to content

Commit 62af74a

Browse files
committed
Preserve is prefix on jackson3 boolean property serialization
1 parent bad8656 commit 62af74a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/kotlin/fi/hsl/jore4/mapmatching/config/JacksonGeoJsonConfig.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import tools.jackson.core.JsonGenerator
88
import tools.jackson.databind.SerializationContext
99
import tools.jackson.databind.SerializationFeature
1010
import tools.jackson.databind.ValueSerializer
11+
import tools.jackson.databind.introspect.DefaultAccessorNamingStrategy
1112
import tools.jackson.databind.module.SimpleModule
1213

1314
@Configuration
@@ -25,6 +26,11 @@ class JacksonGeoJsonConfig {
2526
builder.addModule(module)
2627
builder.disable(SerializationFeature.FAIL_ON_SELF_REFERENCES)
2728
builder.enable(SerializationFeature.WRITE_SELF_REFERENCES_AS_NULL)
29+
30+
// Jackson 3.x treats Kotlin `isXxx` boolean properties as JavaBean is-getters and
31+
// strips the "is" prefix (e.g. `isTraversalForwards` → `traversalForwards`).
32+
// Disable is-getter detection so Kotlin property names are preserved verbatim.
33+
builder.accessorNaming(DefaultAccessorNamingStrategy.Provider().withIsGetterPrefix(""))
2834
}
2935

3036
private class GeoLatteLineStringSerializer : ValueSerializer<LineString<*>>() {

0 commit comments

Comments
 (0)