-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Serialization of transient fields with public getters (add MapperFeature.PROPAGATE_TRANSIENT_MARKER) #296
Comments
The problem is that there is no assumption that 'transient' in field means that the logical property, as accessed using getter/setter is to be ignored. It would be possible to change this logic, but that is a backwards incompatible functional change; so most likely it should be a new In short term, what you can do is to sub-class |
Thanks, it would be good to have such functionality. I will try now with your solution. |
Looked at this briefly, and was about to add a |
Turned out easy enough to implement: the default behavior did not change, but if enabling: Default handling was not changed due to backwards-compatibility concerns, although for Jackson 3.x we could definitely consider changing of defaults. |
Currently when my field is transient (with a public getter) it is serialized. I can put @JsonIgnore annotation to tell jackson to not serialize it. But with this approach my object is coupled directly with jackson. Is it possible to add such functionality to "tell" Jackson globally to not serialize transient fields ? Via ObjectMapper#SerializationFeature/Visibility or something different.
The text was updated successfully, but these errors were encountered: