Description
Since use of Map.Entry
as type is relatively common for constructs like Iterable<Map.Entry<>>
or List<Map.Entry<>>
, it'd make sense to support it.
By default, serialization should probably occur as JSON Object with just one entry. Deserializer will need to do bit of verification after entry, to give more meaningful error for possible case of structural mismatch.
A potential added twist is whether to try to optimize more compact forms: specifically, Iterable
(or Iterator
) of Map.Entry
instances could conceivably be simply serialized as JSON Object, instead of JSON Array of single-entry JSON Objects.
One possibility would be to initially support deserialization of such structure (as it should be detectable from JSON Array vs JSON Object difference); and later on maybe add support for serialization as well, using @JsonFormat
to indicate difference.