We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A JSON field:
@JsonIncludeProperties
@JsonIgnoreProperties
...will still get deserialized as a Record's component with the same name.
Oldest I tried this with is 2.14.2, latest is 2.18.
2.14.2
2.18
record Id2Name(int id, String name) { } record RecordWithJsonIncludeProperties(@JsonIncludeProperties("id") Id2Name child) { } RecordWithJsonIncludeProperties value = new ObjectMapper().readValue("{\"child\":{\"id\":123,\"name\":\"Bob\"}}", RecordWithJsonIncludeProperties.class); // failed with: // org.opentest4j.AssertionFailedError: // Expected :RecordWithJsonIncludeProperties[child=Id2Name[id=123, name=null]] // Actual :RecordWithJsonIncludeProperties[child=Id2Name[id=123, name=Bob]] assertEquals(new RecordWithJsonIncludeProperties(new Id2Name(123, null)), value);
record Id2Name(int id, String name) { } record RecordWithJsonIgnoreProperties(@JsonIgnoreProperties("name") Id2Name child) { } RecordWithJsonIgnoreProperties value = new ObjectMapper().readValue("{\"child\":{\"id\":123,\"name\":\"Bob\"}}", RecordWithJsonIgnoreProperties.class); // failed with: // org.opentest4j.AssertionFailedError: // Expected :RecordWithJsonIgnoreProperties[child=Id2Name[id=123, name=null]] // Actual :RecordWithJsonIgnoreProperties[child=Id2Name[id=123, name=Bob]] assertEquals(new RecordWithJsonIgnoreProperties(new Id2Name(123, null)), value);
No response
NOTE: I'm not personally affected by this, just something I found when testing for #4626 - I thought they have the same cause, but apparently not.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Search before asking
Describe the bug
A JSON field:
@JsonIncludeProperties
, or@JsonIgnoreProperties
...will still get deserialized as a Record's component with the same name.
Version Information
Oldest I tried this with is
2.14.2
, latest is2.18
.Reproduction
For @JsonIncludeProperties
For @JsonIgnoreProperties
Expected behavior
No response
Additional context
NOTE: I'm not personally affected by this, just something I found when testing for #4626 - I thought they have the same cause, but apparently not.
The text was updated successfully, but these errors were encountered: