使用CIRCE库和Cats,能够转换任意Json对象中的所有字符串值,如下所示,这将非常有用:
{
"topLevelStr" : "topLevelVal",
"topLevelInt" : 123,
"nested" : { "nestedStr" : "nestedVal" },
"array" : [
{ "insideArrayStr" : "insideArrayVal1", "insideArrayInt" : 123},
{ "insideArrayStr" : "insideArrayVal2", "insideArrayInt" : 123}
]
}
是否有可能将所有字符串值 (topLevelVal,nestedVal,insideArrayVal1,insideArrayVal2
) 转换为大写字母(或者进行任何其他字符串变换)?