Skip to content

Serializing Map.Entry as Bean with @JsonFormat.shape = Shape.OBJECT fails on JDK 17+ #4963

Description

@cowtowncoder

So, with configuration like:

 ObjectMapper mapper = JsonMapper.builder()
                .withConfigOverride(Map.Entry.class, cfg ->
                    cfg.setFormat(JsonFormat.Value.forShape(JsonFormat.Shape.OBJECT)))
                .build();

attempts to serialize Map.Entry of JDK Maps (like LinkedHashMap) fails due to access problems (unless --add-opens is used).

There is an existing test that fails this way. But we should be able to have a serializer that works with public API in this case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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