【发布时间】:2019-01-03 12:55:32
【问题描述】:
使用 CIRCE 库和 Cats,能够转换任意 Json 对象的所有 string 值将非常有用,例如
{
"topLevelStr" : "topLevelVal",
"topLevelInt" : 123,
"nested" : { "nestedStr" : "nestedVal" },
"array" : [
{ "insideArrayStr" : "insideArrayVal1", "insideArrayInt" : 123},
{ "insideArrayStr" : "insideArrayVal2", "insideArrayInt" : 123}
]
}
是否可以将所有字符串值(topLevelVal, nestedVal, insideArrayVal1, insideArrayVal2) 转换为大写(或任何任意字符串转换)?
【问题讨论】:
-
哦,是的,这会很有帮助!
标签: json scala recursion scala-cats