Skip to content

Add support for handling Map.Entry #565

Closed
@cowtowncoder

Description

@cowtowncoder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions