Skip to content

ACCEPT_CASE_INSENSITIVE_PROPERTIES not applied to @JsonUnwrapped properties #6247

Open

Description

@cowtowncoder

With MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES enabled, properties of a @JsonUnwrapped value are only matched if the input name has exactly the same case as the property name; names that differ in case are silently ignored (no exception, value left null).

This happens both with and without prefix, and for both field and Creator properties.

(Noticed while working on #6246, which fixed exact-case matching of Creator properties for @JsonUnwrapped with prefix/suffix when case-insensitivity is enabled.)

Reproduction

static class Outer {
    @JsonUnwrapped(prefix = "inner-")
    public Inner inner;
}

static class OuterNoPrefix {
    @JsonUnwrapped
    public Inner inner;
}

static class Inner {
    public String myName;
}

ObjectMapper mapper = JsonMapper.builder()
        .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)
        .build();

// All of these fail: `inner.myName` is `null`
mapper.readValue("{\"INNER-MYNAME\":\"b\"}", Outer.class);
mapper.readValue("{\"inner-MYNAME\":\"b\"}", Outer.class);
mapper.readValue("{\"MYNAME\":\"b\"}", OuterNoPrefix.class);

// whereas exact-case names work:
mapper.readValue("{\"inner-myName\":\"b\"}", Outer.class);

Same for a Creator-only Inner (@JsonCreator constructor with @JsonProperty("myName"), no setter or field).

Expected

Unwrapped properties should be matched case-insensitively, same as regular properties.

Version

Observed on 3.1 branch (3.1.x-SNAPSHOT); not yet checked on 2.x.

Activity

  1. added a commit that references this issue on Sep 29, 2026
    b27db2b
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