我有输入 JSON
{
"MainObj": {
"SubObject": {
"Invoices": [
{
"InvoiceItemsDetail": [
{
"InvoiceItemLineNumber": "1",
"ItemCode": "122",
"Description": "GoodsDescription1"
},
{
"InvoiceItemLineNumber": "2",
"ItemCode": "222",
"Description": "GoodsDescription2"
}
]
},
{
"InvoiceItemsDetail": [
{
"InvoiceItemLineNumber": "3",
"ItemCode": "322",
"Description": "GoodsDescription3"
},
{
"InvoiceItemLineNumber": "4",
"ItemCode": "422",
"Description": "GoodsDescription4"
}
]
}
]
}
}
}
我需要不包含“AnotherObject”和“SomeOtherObject”的结果。
生成的 JSON 将包含
InvoiceItemLineNumber
转换为INVOICE_LINE_ITEM_NUMBER
,ItemCode
至ITEM_CODE
和Description
到DESCRIPTION
所有这些都包含在一个数组中"outputs"
{
"outputs": [
{
"INVOICE_LINE_ITEM_NUMBER": "1",
"ITEM_CODE": "122",
"DESCRIPTION": "GoodsDescription1"
},
{
"INVOICE_LINE_ITEM_NUMBER": "2",
"ITEM_CODE": "222",
"DESCRIPTION": "GoodsDescription2"
},
{
"INVOICE_LINE_ITEM_NUMBER": "3",
"ITEM_CODE": "322",
"DESCRIPTION": "GoodsDescription3"
},
{
"INVOICE_LINE_ITEM_NUMBER": "4",
"ITEM_CODE": "422",
"DESCRIPTION": "GoodsDescription4"
}
]
}
您只需要
"*": "[]"
键值对作为转换的最内层部分,例如网站上的演示Jolt Transform Demo Using v0.1.1是:
编辑:考虑到您需要重命名新编辑案例的属性,您可以使用以下规范: