Skip to content

Commit

Permalink
Fix related to #2576 (3.0 has Shape.POJO, in addition to Shape.OBJECT…
Browse files Browse the repository at this point in the history
…, both should work)
  • Loading branch information
cowtowncoder committed Dec 20, 2019
1 parent a26552b commit 5f0e9f6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,8 @@ protected JsonSerializer<?> buildEnumSerializer(SerializerProvider ctxt,
// Challenge here is that EnumSerializer does not know how to produce
// POJO style serialization, so we must handle that special case separately;
// otherwise pass it to EnumSerializer.
if (effectiveFormat.getShape() == JsonFormat.Shape.POJO) {
JsonFormat.Shape shape = effectiveFormat.getShape();
if (shape == JsonFormat.Shape.POJO || shape == JsonFormat.Shape.OBJECT) {
// one special case: suppress serialization of "getDeclaringClass()"...
((BasicBeanDescription) beanDesc).removeProperty("declaringClass");
// returning null will mean that eventually BeanSerializer gets constructed
Expand Down

0 comments on commit 5f0e9f6

Please sign in to comment.