Skip to content

Add support for JsonUnwrapped #138

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

Merged
merged 1 commit into from
Jul 12, 2020
Merged

Add support for JsonUnwrapped #138

merged 1 commit into from
Jul 12, 2020

Conversation

tsachev
Copy link
Contributor

@tsachev tsachev commented Jul 11, 2020

Here is PR that adds support for @JsonUnwrapped properties that are proxies.

Fix for #97

@tsachev
Copy link
Contributor Author

tsachev commented Jul 11, 2020

I created the PR against 2.11 since this is the current stable branch, but it currently cannot be directly merged in master.


String json = mapper.writeValueAsString(new HasUnwrapped<>(product));

System.out.println(json);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please remove this line

@cowtowncoder
Copy link
Member

First of all: thank you for this contribution!

One quick question: do you think deserialization also works? If so, would be nice to just add code to read serialization back.
If not, that's fine too, just needs to be noted (could file a separate issue for follow-up work).

Beyond that, merging into 2.11 is fine as no new functionality is added, but I suspect that a new feature merged into 2.12 (see #136) might make merging 2.11 -> 2.12 bit difficult.
But I can probably figure it out, and maybe start removing some of intermediate constructors to remove long chaining. So that's fine.

And then the final thing: unless I have asked for (I do not think I have, but apologies if I have) CLA yet, I would need one filled:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

this only needs to be done once before the first contribution and then it works for all future PRs.
It is usually easiest to print, fill & sign, scan/photo, email to info at fasterxml dot com.
Once I get that, I can proceed with merging.

Once again, thank you for contributing this fix; looking forward to merging it!

@cowtowncoder
Copy link
Member

Ah never mind! I noticed you already sent the CLA, thank you very much!

@tsachev
Copy link
Contributor Author

tsachev commented Jul 12, 2020

@cowtowncoder thank you for your comments.

I changed the tests so they are now not printing to the console and to read back the serialized json.
It turns out that reading the value works as expected.

Note that I force pushed my changes to keep them in a single commit.

@cowtowncoder
Copy link
Member

@tsachev Excellent, thank you. I will have one more look before merging.

@cowtowncoder cowtowncoder merged commit 228272a into FasterXML:2.11 Jul 12, 2020
@ptahchiev
Copy link

@cowtowncoder
Copy link
Member

2.11.1 was released on 25-Jun-2020 as per release notes, so this will go in 2.11.2, not yet released.

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

Successfully merging this pull request may close these issues.

3 participants