Skip to content

@JsonFormat(shape = Shape.POJO) does not work for java.util.Map serialization via property annotation #5405

Closed

Description

@cowtowncoder

(note: split off from #1419 )

So, although Class/default-config to serialize Maps works, doing the same via property annotation doesn't.
Following:

    static class Bean476Container
    {
        @JsonFormat(shape=JsonFormat.Shape.POJO)
        public Map<String, Object> stuff;
    }

will not use "POJO" style serialization.

Activity

  1. added
    3.xIssues to be only tackled for Jackson 3.x, not 2.x
    on Nov 19, 2025
  2. added a commit that references this issue on Nov 19, 2025
  3. added
    has-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issue
    on Nov 19, 2025
  4. added a commit that references this issue on Dec 1, 2025
  5. added a commit that references this issue on Dec 1, 2025
    2a15b6c
  6. JacksonJang commented on Dec 1, 2025

    @JacksonJang
    Contributor

    I just submitted the PR.
    I was considering branching based on the shape (POJO or OBJECT), but ended up using empty instead.
    I wasn’t completely sure which approach would be better, so I pushed it.

  7. added a commit that references this issue on Dec 6, 2025
    046dedd
  8. added this to the 3.1.0 milestone on Dec 13, 2025
  9. added a commit that references this issue on Dec 13, 2025
    139dcf9
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

    3.xIssues to be only tackled for Jackson 3.x, not 2.xhas-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions