【问题标题】:Convert jsonObject to Map in scala programming language用scala编程语言将jsonObject转换为Map
【发布时间】:2019-04-12 13:51:25
【问题描述】:

我正在使用 Scala 编程语言。

我想将 json 对象转换为 Map[String, String]

我的 jsonObject 看起来像

{"Key1":"Val1","Key2":"Val2","Key3":"Val3"}

我想要一个类似的地图

Map("Key1" -> "Val1", "Key2" -> "Val2", "Key3" -> "Val3")

我该怎么做? 注意:我正在使用 Gson 进行其他 json 操作

谢谢

【问题讨论】:

标签: json scala gson deserialization


【解决方案1】:

您可以为此使用 Jackson 对象映射器。

https://www.alexkras.com/parse-json-object-to-map-in-scala-using-jackson/

【讨论】:

    猜你喜欢
    • 2014-02-27
    • 1970-01-01
    • 2014-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-14
    • 1970-01-01
    相关资源
    最近更新 更多