How to convert Scala Map into JSON String?

前端 未结 7 1792
一向
一向 2021-02-07 04:19

For example, I have this Map value in Scala:

val m = Map(
    \"name\" -> \"john doe\", 
    \"age\" -> 18, 
    \"hasChild\" -> true, 
    \"childs\" -         


        
相关标签:
7条回答
  • 2021-02-07 04:46

    You need to tell jackson how to deal with scala objects: mapper.registerModule(DefaultScalaModule)

    0 讨论(0)
提交回复
热议问题