-
Notifications
You must be signed in to change notification settings - Fork 19
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
Avoid load of not requested lazy properties #6
Comments
Hey Giovanni, this is hard to avoid with the current design. Our message body writer converts the response to a A different approach would be to use Jackson's native |
I played around with this for a little bit but ran into a few issues. Let me know if you have any other ideas, otherwise I don't think there's much we can do to solve this use-case unfortunately |
Hi @jhaber and thank for your interest in this issue. I'm sure this is doable with Jackson's It supports runtime filtering by query string parameter, filtering by security constraints and custom annotation based filters; and all before Jackson serialization, thus preventing access to lazy loaded properties. [1] https://github.com/jersey/…/org/glassfish/jersey/message/filtering |
If you need contextual serialization then you could use this: https://www.baeldung.com/jackson-json-view-annotation |
On a JPA project, when a POJO has a
List<Bean>
property which should be lazy-loaded, the loading gets triggered even if I'm not requesting the property in the filter. It would be great to instruct Jackson not to call the getter of these properties to avoid unnecessary loading!The text was updated successfully, but these errors were encountered: