-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
(This is happening with 2.5.0. Haven't tried 2.5.1 but I couldn't see any related issue anyway)
Jackson ignores JsonSerialize annotation when there is JsonAnyGetter annotation.
@JsonSerialize(using = MySerializer.class)
// or
@JsonSerialize(converter = MyConverter.class)
@JsonAnyGetter
public Map<String, String> getParameters(){
return parameters;
}
except
@JsonSerialize(keyUsing = MyKeySerializer.class)
(haven't tried each setting. Only tried keyUsing because I've seen a different issue (#661) with it)
Then it works. But I need the converter, so..
For the time being I will use
@JsonAnyGetter
public Map<String, JsonNode> getParameters(){
return new MyConverter().convert(parameters);
}
but I'd prefer to stick to annotations.
Metadata
Metadata
Assignees
Labels
No labels