Skip to content
5 changes: 5 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ Oliver Drotbohm (@odrotbohm)
* Contributed #1196: Add opt-in error collection for deserialization
[3.1.0]

@JacksonJang
* Contributed fix for #4629: `@JsonIncludeProperties` and `@JsonIgnoreProperties`
ignored when deserializing Records
[3.1.0]

Hélios Gilles (@RoiSoleil)
* Contributed #5413: Add/support forward reference resolution for array values
[3.1.0]
Expand Down
5 changes: 5 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Project: jackson-databind
Versions: 3.x (for earlier see VERSION-2.x)

Expand All @@ -12,6 +13,10 @@ Versions: 3.x (for earlier see VERSION-2.x)
(contributed by @sri-adarsh-kumar)
#1980: Add method `remove(JsonPointer)` in `ContainerNode`
(fix by @cowtowncoder, w/ Claude code)
#4629: `@JsonIncludeProperties` and `@JsonIgnoreProperties` ignored when
deserializing Records
(reported by Sim Y-T)
(fix contributed by @JacksonJang)
#5350: Add `DeserializationFeature.USE_NULL_FOR_MISSING_REFERENCE_VALUES` for
selecting `null` vs "empty/absent" value when deserializing missing `Optional` value
#5361: Fix Maven SBOM publishing (worked in 3.0.0-rc4 but not in rc5 or later)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,14 @@ protected Object _deserializeUsingPropertyBased(final JsonParser p, final Deseri
if (buffer.readIdProperty(propName) && creatorProp == null) {
continue;
}
// [databind#1891]: possible fix
/*
if (_ignorableProps != null && _ignorableProps.contains(propName)){

// [databind#4629] Need to check for ignored properties BEFORE checking for Creator properties.
// Records (and other creator-based types) will have a valid 'creatorProp', so if we don't
// check for ignore first, the ignore configuration will be bypassed.
if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, handledType(), propName);
continue;
}
*/

// Creator property?
if (creatorProp != null) {
Expand Down Expand Up @@ -660,11 +662,7 @@ protected Object _deserializeUsingPropertyBased(final JsonParser p, final Deseri
continue;
}
}
// Things marked as ignorable should not be passed to any setter
if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) {
handleIgnoredProperty(p, ctxt, handledType(), propName);
continue;
}

// "any property"?
if (_anySetter != null) {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.jackson.databind.records.tofix;
package tools.jackson.databind.records;

import org.junit.jupiter.api.Test;

Expand All @@ -7,7 +7,6 @@

import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.testutil.DatabindTestUtil;
import tools.jackson.databind.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand All @@ -31,7 +30,6 @@ record RecordWIthIgnore4629(

private final ObjectMapper MAPPER = newJsonMapper();

@JacksonTestFailureExpected
@Test
void testJsonInclude4629()
throws Exception
Expand All @@ -44,7 +42,6 @@ void testJsonInclude4629()
assertEquals(expected, actual);
}

@JacksonTestFailureExpected
@Test
void testJsonIgnore4629()
throws Exception
Expand Down