我有一个带有变量的JSON,我需要忽略第一个数字.
{
"destinatarioDTO" : {
"cnpj" : "01377071000170"
}
}
我用EvaluateJsonPath获得了变量.
我需要将结果01377071000170
转换为1377071000170
(go 掉第一个数字).
我有一个带有变量的JSON,我需要忽略第一个数字.
{
"destinatarioDTO" : {
"cnpj" : "01377071000170"
}
}
我用EvaluateJsonPath获得了变量.
我需要将结果01377071000170
转换为1377071000170
(go 掉第一个数字).
您可以添加一个JoltTransformJSON处理器以及以下规格
[
{
"operation": "modify-overwrite-beta",
"spec": {
"destinatarioDTO": {
"len_cnpj": "=size(@(1,cnpj))",
"cnpj": "=substring(@(1,cnpj),1,@(1,len_cnpj))" // extract the value starting from the second character(one with the index 1) till the end of the string
}
}
},
{
"operation": "remove",
"spec": {
"destinatarioDTO": {
"len_cnpj": "" // get rid of newly generated, auxiliary attribute
}
}
}
]