Converting nested case classes to nested Maps using Shapeless

前端 未结 2 412
天涯浪人
天涯浪人 2020-12-01 06:35

I am trying to solve this question using Shapeless, in summary it\'s about converting a nested case class to Map[String,Any], here is the example:

case class         


        
2条回答
  •  遥遥无期
    2020-12-01 07:14

    I have a problem with an approach provided by Travis Brown.
    Some of nesting case classes are not converted to Map https://scalafiddle.io/sf/cia2jTa/0.

    The answer was found here.
    To correct the solution just wrap ToMapRec[T] in implicit parameters to Lazy[ToMapRec[T]]. Corrected fiddle https://scalafiddle.io/sf/cia2jTa/1

提交回复
热议问题