You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have 2 classes Cat and Dog. For Cat with property name someflag serialization will works fine. But for Dog - no.
data classDog(@JsonProperty("is_active") valisActive:Boolean)
data classCat(@JsonProperty("is_active") valsomeflag:Boolean)
val mapper =ObjectMapper()
mapper.registerModule(KotlinModule())
val dogJson = mapper.writeValueAsString(Dog(true))
val catJson = mapper.writeValueAsString(Cat(true))
// dogJson is {"active": true} -- NOT OK, should be "is_active"// catJson is {"is_active": true} -- OK
We expect that dogJson and catJson will be {"is_active": true}, but dogJson is {"active": true} for unknown reason.
We have 2 classes Cat and Dog. For Cat with property name
someflag
serialization will works fine. But for Dog - no.We expect that
dogJson
andcatJson
will be{"is_active": true}
, but dogJson is{"active": true}
for unknown reason.Jackson version:
The text was updated successfully, but these errors were encountered: