Fix error deserializing enum values with flattening Jackson2HashMapper.

This commit makes sure the mapper does not attempt to read type alias when deserializing enums.

Original pull request: #2980
Closes #2979
This commit is contained in:
Christoph Strobl
2024-08-28 12:27:20 +02:00
committed by Mark Paluch
parent 5fb06655d9
commit bea01ef36c
2 changed files with 44 additions and 1 deletions

View File

@@ -177,7 +177,7 @@ public class Jackson2HashMapper implements HashMapper<Object, String, Object> {
return false;
}
if (flatten && type.isTypeOrSubTypeOf(Number.class)) {
if (flatten && (type.isTypeOrSubTypeOf(Number.class) || type.isEnumType())) {
return false;
}