-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
@JsonIgnore
and @JsonProperty.access=READ_ONLY
on Record property ignored for deserialization
#4628
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
Closed
1 task done
Milestone
Comments
1 task
iifawzi
added a commit
to iifawzi/jackson-databind
that referenced
this issue
Apr 6, 2025
Signed-off-by: Fawzi Essam <[email protected]>
cowtowncoder
pushed a commit
that referenced
this issue
Apr 6, 2025
…d-access when json renamed to same property name (#5073)
Parts of this issue fixed via #5073 but some issue(s) still remain so left open. |
...specifically, this scenario is fixed: For
|
Ok. And the remaining case is bit odd too; use of both I think I'll add a case with POJO to show how it should work. |
cowtowncoder
added a commit
that referenced
this issue
Apr 7, 2025
@JsonIgnore
and @JsonProperty.access=READ_ONLY
on Record property ignored for deserialization
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search before asking
Describe the bug
When a
@JsonProperty.value
is given the same value as the property it is annotated on,@JsonProperty.access=READ_ONLY
seems to be ignored during deserialization.Version Information
Oldest I tested this with is
2.14.2
, latest is2.18
.Reproduction
For
@JsonIgnore
For
@JsonProperty.access=READ_ONLY
Expected behavior
No response
Additional context
NOTE: Seems to be an edge case that user wouldn't/shouldn't encounter. Not reproducible for non-Record classes. I'm not personally affected by this, just something I found when working on #4624:
@JsonIgnore
: https://github.com/yihtserns/jackson-databind/blob/8c14e0916647128082cd8739d7e87e3884c1aa5e/src/test-jdk17/java/com/fasterxml/jackson/databind/records/RecordWithJsonIgnoreTest.java#L64-L68@JsonProperty.access=READ_ONLY
: https://github.com/yihtserns/jackson-databind/blob/8c14e0916647128082cd8739d7e87e3884c1aa5e/src/test-jdk17/java/com/fasterxml/jackson/databind/records/RecordWithReadOnlyTest.java#L85-L93The text was updated successfully, but these errors were encountered: