Skip to content

Commit 8328baf

Browse files
committed
Update release notes wrt #3647 fix
1 parent ae77a0c commit 8328baf

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

release-notes/VERSION-2.x

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Project: jackson-databind
1010
(contributed by Joo-Hyuk K)
1111
#2787: Mix-ins do not work for `Enum`s
1212
(fix contributed by Joo-Hyuk K)
13+
#3647: `@JsonIgnoreProperties` not working with `@JsonValue`
14+
(reported by @ThatSneakyRaccoon)
15+
(fix contributed by Joo-Hyuk K)
1316
#3780: Deprecated JsonNode.with(String) suggests using JsonNode.withObject(String)
1417
but it is not the same thing
1518
(reported by @bmatasar)

src/main/java/com/fasterxml/jackson/databind/ser/std/JsonValueSerializer.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,15 @@ protected JsonSerializer<Object> _findDynamicSerializer(SerializerProvider ctxt,
455455
* @return Configured serializer with specified properties ignored
456456
* @since 2.16
457457
*/
458-
private JsonSerializer<?> _withIgnoreProperties(SerializerProvider ctxt, JsonSerializer<?> ser) {
459-
final AnnotationIntrospector ai = ctxt.getAnnotationIntrospector();
460-
final SerializationConfig config = ctxt.getConfig();
461-
462-
JsonIgnoreProperties.Value ignorals = ai.findPropertyIgnoralByName(config, _accessor);
458+
@SuppressWarnings("unchecked")
459+
protected JsonSerializer<Object> _withIgnoreProperties(SerializerProvider ctxt, JsonSerializer<?> ser) {
460+
JsonIgnoreProperties.Value ignorals = ctxt.getAnnotationIntrospector()
461+
.findPropertyIgnoralByName(ctxt.getConfig(), _accessor);
463462
Set<String> ignored = ignorals.findIgnoredForSerialization();
464-
ser = ser.withIgnoredProperties(ignored);
465-
return ser;
463+
if (!ignored.isEmpty()) {
464+
ser = ser.withIgnoredProperties(ignored);
465+
}
466+
return (JsonSerializer<Object>) ser;
466467
}
467468

468469
/*

0 commit comments

Comments
 (0)