Skip to content

Commit 5f0e9f6

Browse files
committed
Fix related to #2576 (3.0 has Shape.POJO, in addition to Shape.OBJECT, both should work)
1 parent a26552b commit 5f0e9f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,8 @@ protected JsonSerializer<?> buildEnumSerializer(SerializerProvider ctxt,
11291129
// Challenge here is that EnumSerializer does not know how to produce
11301130
// POJO style serialization, so we must handle that special case separately;
11311131
// otherwise pass it to EnumSerializer.
1132-
if (effectiveFormat.getShape() == JsonFormat.Shape.POJO) {
1132+
JsonFormat.Shape shape = effectiveFormat.getShape();
1133+
if (shape == JsonFormat.Shape.POJO || shape == JsonFormat.Shape.OBJECT) {
11331134
// one special case: suppress serialization of "getDeclaringClass()"...
11341135
((BasicBeanDescription) beanDesc).removeProperty("declaringClass");
11351136
// returning null will mean that eventually BeanSerializer gets constructed

0 commit comments

Comments
 (0)