如何删除 JSON 中的多个根元素?
How to Remove multiple root element in JSON?
"{
"LEINumber": "335800QRNLKAHGA1BL68",
"LegalName": "METROPOLITAN CLEARING CORPORATION OF INDIA LIMITED",
"NextRenewalDate": "04-03-2022 00:00:00 +05:30",
"LegalForm": "Public Limited Companies",
"RegistrationStatus": "ISSUED"
}"
在上面的 Json 数据包中,我想删除 JSON 中的“”。所以删除“”后我想要以下格式的数据。
{
"LEINumber": "335800QRNLKAHGA1BL68",
"LegalName": "METROPOLITAN CLEARING CORPORATION OF INDIA LIMITED",
"NextRenewalDate": "04-03-2022 00:00:00 +05:30",
"LegalForm": "Public Limited Companies",
"RegistrationStatus": "ISSUED"
}
这个简单的解决方案是在 apigee 中打印不在“”中的数据。如果您使用双引号,它将以逗号打印数据,但如果您打印没有双引号的数据,它将不会以逗号打印,如下所示。
{
"LEINumber": "335800QRNLKAHGA1BL68",
"LegalName": "METROPOLITAN CLEARING CORPORATION OF INDIA LIMITED",
"NextRenewalDate": "04-03-2022 00:00:00 +05:30",
"LegalForm": "Public Limited Companies",
"RegistrationStatus": "ISSUED"
}
"{
"LEINumber": "335800QRNLKAHGA1BL68",
"LegalName": "METROPOLITAN CLEARING CORPORATION OF INDIA LIMITED",
"NextRenewalDate": "04-03-2022 00:00:00 +05:30",
"LegalForm": "Public Limited Companies",
"RegistrationStatus": "ISSUED"
}"
在上面的 Json 数据包中,我想删除 JSON 中的“”。所以删除“”后我想要以下格式的数据。
{
"LEINumber": "335800QRNLKAHGA1BL68",
"LegalName": "METROPOLITAN CLEARING CORPORATION OF INDIA LIMITED",
"NextRenewalDate": "04-03-2022 00:00:00 +05:30",
"LegalForm": "Public Limited Companies",
"RegistrationStatus": "ISSUED"
}
这个简单的解决方案是在 apigee 中打印不在“”中的数据。如果您使用双引号,它将以逗号打印数据,但如果您打印没有双引号的数据,它将不会以逗号打印,如下所示。
{
"LEINumber": "335800QRNLKAHGA1BL68",
"LegalName": "METROPOLITAN CLEARING CORPORATION OF INDIA LIMITED",
"NextRenewalDate": "04-03-2022 00:00:00 +05:30",
"LegalForm": "Public Limited Companies",
"RegistrationStatus": "ISSUED"
}