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

Handling JsonUnwrapped #33

Open
stevenhurth opened this issue Sep 28, 2016 · 0 comments
Open

Handling JsonUnwrapped #33

stevenhurth opened this issue Sep 28, 2016 · 0 comments

Comments

@stevenhurth
Copy link

Maybe I am missing something, but it appears that any elements that I've marked as JsonUnwrapped are actually wrapped in the resulting json. If I don't use JsonView, everything is as expected.

For example:

class User {
    @JsonUnwrapped
    private Name name;
    ...
}

class Name {
    private String firstName = "John";
    private String lastName = "Doe";
    ...
}

I would expect the resulting json to come back as:

{
    firstName: "John",
    lastName: "Doe"
}

But it is coming back as:

{
    name: {
        firstName: "John",
        lastName: "Doe"
    }
}

Maybe I am just missing something? I also tried annotating the getter instead; to no avail.

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

1 participant