Skip to content

Commit 4312a24

Browse files
committed
Fix #878
1 parent 726b6e0 commit 4312a24

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

release-notes/CREDITS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,8 @@ Kamil Benedykciński (Kamil-Benedykcinski@github)
261261
in `JsonMappingException`
262262
(2.5.4)
263263

264+
Chi Kim (chikim79@github)
265+
* Reported #878: serializeWithType on BeanSerializer does not setCurrentValue
266+
(2.5.5 / 2.6.1)
267+
264268

release-notes/VERSION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Project: jackson-databind
99
#844: Using JsonCreator still causes invalid path references in JsonMappingException
1010
(reported by Ian B)
1111
#852: Accept scientific number notation for quoted numbers too
12+
#878: serializeWithType on BeanSerializer does not setCurrentValue
13+
(reported by Chi K, chikim79@github)
1214

1315
2.5.4 (09-Jun-2015)
1416

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ public void serializeWithType(Object bean, JsonGenerator gen,
546546
} else {
547547
typeSer.writeCustomTypePrefixForObject(bean, gen, typeStr);
548548
}
549+
// [databind#631]: Assign current value, to be accessible by custom serializers
550+
gen.setCurrentValue(bean);
549551
if (_propertyFilterId != null) {
550552
serializeFieldsFiltered(bean, gen, provider);
551553
} else {

0 commit comments

Comments
 (0)