-
-
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
JsonProperty.Access.READ_ONLY not work #1805
Comments
Facing the same problem, in issue #935, seems only simple types were handled correctly. I looked into the code, the issue was caused by some special logic for USE_GETTERS_AS_SETTERS, in BeanDeserializerFactory Line 565 (version 2.8.10):
By default USE_GETTERS_AS_SETTERS is enabled, so, although the Collection member was defined Access as "READ_ONLY", still, it is set as a property in the builder instance. My work around is using (for spring boot applications) However, I'm not sure this behavior is a bug or not, @cowtowncoder please help to clarify. |
Yes, it sounds like this might be due to conflict between "getter-as-setter" (only used for |
Is any solution available for this, besides disabling USE_GETTERS_AS_SETTERS across the whole object mapper? |
@clamothe No progress as of yet, but I'll try to add a test to verify. I have worked on a few issues related to |
Oh. I think this is dup of #1382. Closing -- will fix both, but since that was filed earlier I'll keep that. |
Thanks! I'll test against 2.9.4. Update: Old workaround was: |
I just released |
I want to disable one field deserialization, so first I add annotaion JsonProperty to the field, but it still throw exception in deserialization process.
Then I tried JsonIgnoreProperties, and annotate the class with specified field, jackson ignores the field and works as expected.
Below is the code:
The first testcase will throw exception and it's stacktrace is:
The text was updated successfully, but these errors were encountered: