Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@JsonUnwrapped fields are skipped when using PropertyBasedCreator if they appear after the last creator property #2088

Closed
6bangs opened this issue Jul 16, 2018 · 1 comment
Milestone

Comments

@6bangs
Copy link

6bangs commented Jul 16, 2018

Example:

    static class Bean {
        int x;
        int y;

        @JsonUnwrapped
        UnwrappedBean w;

        public Bean(@JsonProperty("x") int x, @JsonProperty("y") int y) {
            this.x = x;
            this.y = y;
        }

        public void setW(UnwrappedBean w) {
            this.w = w;
        }
    }

    static class UnwrappedBean {
        int a;
        int b;

        public UnwrappedBean(@JsonProperty("a") int a, @JsonProperty("b") int b) {
            this.a = a;
            this.b = b;
        }
    }
    {"x": 1, "a": 2, "y": 3, "b": 4}

x, y, and a are deserialized as expected. b is skipped entirely. I think I've found the root cause and the fix doesn't appear to break any tests; opening a PR for further review.

6bangs added a commit to vi-technologies/jackson-databind that referenced this issue Jul 16, 2018
6bangs added a commit to vi-technologies/jackson-databind that referenced this issue Jul 16, 2018
@cowtowncoder
Copy link
Member

Thank you for reporting this -- not sure how I managed to miss it. Looking now, hoping to merge for 2.9.7.

@cowtowncoder cowtowncoder added 2.9 and removed ACTIVE labels Aug 29, 2018
@cowtowncoder cowtowncoder added this to the 2.9.7 milestone Aug 29, 2018
@cowtowncoder cowtowncoder changed the title @JsonUnwrapped fields are skipped when using PropertyBasedCreator if they appear after the last creator property @JsonUnwrapped fields are skipped when using PropertyBasedCreator if they appear after the last creator property Aug 29, 2018
cowtowncoder added a commit that referenced this issue Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants