我试图连载GeneralResponse
:杰克逊映射器在Scala中的泛型类
case class GeneralResponse[T](succeeded: Boolean, payload: Option[T])
和有效载荷为GroupsForUserResult
:
case class GroupsForUserResult(groups: Seq[UUID]).
我使用mapper.readValue(response.body, classOf[GeneralResponse[GroupsForUserResult]])
,但不幸的是,有效载荷序列化为Map
而不是所期望的案例类别(GroupForUserResult
)。
太棒了!谢谢! – Gal
它不适用于我的情况。具有'case InputMessage [+ S <:Storage,+ P <:Partitioning](fromView:View [S,P],toView:View [S,P],partition:Partition)'和'ObjMapper.readValue [InputMessage [ S3Storage,TimePartitioning]](inputMsg,new TypeReference [InputMessage [S3Storage,TimePartitioning]](){})'我仍然收到错误 – lisak