I'm currently working on modifying the following JSON text. It has the structure as shown below:
{
"cabecera": {
"tipo_cambio": "",
"fecha_emision": "",
"total": ""
},
"detalle": {
"940b130369614bd6b687dc5b41623439": {
"producto": "94115891",
"detalle_adicional": "",
"cantidad": "",
"precio_unitario": "",
"subtotal": "",
"total": ""
},
"6cbdcef2bbff4b059c8de7432c9aa5f2": {
"producto": "6738756",
"detalle_adicional": "",
"cantidad": "",
"precio_unitario": "",
"subtotal": "",
"total": ""
}
}
}
My goal is to transform it into the following structure where unique codes like "940b130369614bd6b687dc5b41623439" are removed, and detalle becomes an array:
{
"cabecera": {
"tipo_cambio": "",
"fecha_emision": "",
"total": ""
},
"detalle": [
{
"producto": "94115891",
"detalle_adicional": "",
"cantidad": "",
"precio_unitario": "",
"subtotal": "",
"total": ""
},
{
"producto": "6738756",
"detalle_adicional": "",
"cantidad": "",
"precio_unitario": "",
"subtotal": "",
"total": ""
}
]
}
Is there a way to achieve this using C#?