Closed aatasiei closed 4 years ago
Thanks for the issue, we'll take a look!
@aatasiei we addressed this with a more holistic fix (which also provides a different fix for #548) in a6ba62b6b53ac5470a3b99a36634ec0f35600540.
that's great news! thank you very much!
Jackson deserialisation issue: when using
Option[T]
as a field in a generic case class,T
will always be deserialised as aMap
.Expected behavior
Actual behavior
The same happens even if you specialise
AGeneric
when using it as a field in another class:Steps to reproduce the behavior
Actual behavior contains a minimal example.
During my debugging, I've tracked the setting of the
scalaType
asOption[Object]
to this line in CaseClassDeserializer.scalaThe
Reflector.describe
call is made againstclazz
which is set tojavaType.getRawClass
. Maybedescribe
could be called with theReflector.scalaTypeOf(javaType)
? (a suggestion based on how I saw the types align, but haven't tested it.)