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
Given a Map[K,V], type K's @JsonSerialize annotation is ignored, though type V's isn't. The problem doesn't happen with Seq[V].
Note that by K and V I mean any type at all -- invert the map to Map[V,K], and now V's serializer is ignored but K isn't.
Maybe it has something to do with keys in JSON being strings? This is happening to me even though the specialized serializer I'm using does produce strings as serialization, though.
The text was updated successfully, but these errors were encountered:
Correct @pjfanning : serializers and deserializers used with Map keys are separate from "regular" value (de)serializers and are both:
Registered separately (there's a smaller set of default types supported, too)
Use different property in case of per-class or per-property annotations, as in your example
Difference is historical, but since JSON Object keys MUST be Strings, KeyDeserializer is separate implementation type (for serialization JsonSerializer is used but other constraints apply); and from this their handling is quite distinct.
Given a
Map[K,V]
, typeK
's@JsonSerialize
annotation is ignored, though typeV
's isn't. The problem doesn't happen withSeq[V]
.Note that by
K
andV
I mean any type at all -- invert the map toMap[V,K]
, and nowV
's serializer is ignored butK
isn't.Maybe it has something to do with keys in JSON being strings? This is happening to me even though the specialized serializer I'm using does produce strings as serialization, though.
The text was updated successfully, but these errors were encountered: