-
Notifications
You must be signed in to change notification settings - Fork 106
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
fails for HibernateProxy instances
#97
Comments
I don't doubt this happens, but a reproducible unit test would be very helpful. |
I am working on a test case. Meanwhile I am also trying to step through the code a bit. |
@jwgmeligmeyling Isn't
|
I see why the |
PRs welcome! Note: due to lack of development it is possible and perhaps likely this module will be deprecated and not maintained in future. |
We're running into this in DATAREST-1494. The ultimate place tthigs start to diverge compared to non-proxy rendering is if (!ser.isUnwrappingSerializer()) {
gen.writeFieldName(_name);
}
Happy to provide a pull request. |
@odrotbohm that fix actually makes a lot of sense. I never had the time to finish this myself (probably have some old branch from years ago with a reproducer if I dig deep...). I'd say go ahead and see if the fix works! It sounds promising to me. I think we find out soon enough if unwrapped serialization is really limited to |
I'd still wait for some input by @cowtowncoder to whether my interpretation is correct. 🙃 |
Without having (had time to) look(ed), that does sound reasonable. I'll add this issue to my "to evalute" list to have a look before finalizing 2.11.0. |
@odrotbohm Ok. So, meaning of
is what would be needed to "change" proxy serializer to unwrapping one. It would be relatively easy to change that to create standard unwrapping bean serializer; however, that would then not handle proxy part of handling. Instead Hibernate module would either add handling of unwrapped properties into proxy serializer itself, or, subclass This is doable but not a trivial change. If anyone wants to tackle it, I can probably help. I think some other module does this but I am not sure which one (Afterburner module, perhaps). |
@JsonUnwrapped
fails for HibernateProxy instances
Just wanted to mention that the PR for this issue was sponsored by Nemesis Software (http://nemesis.io) :) |
Excellent, thank you to Nemesis Software then! Would you like me to add a note to |
Yes, sure |
@JsonUnwrapped
fails for HibernateProxy instances. They are serialized as if the@JsonUnwrapped
annotation was missing.Work around:
Replace the object with its underlying implementation:
Tested on the following dependencies:
The text was updated successfully, but these errors were encountered: