简体   繁体   中英

cannot deserialize the current json object Message shows when I try to read the below Json data into Objects

Having trouble when trying to deserialize the following JSON content into objects, especially the content in eInv part

{
    "requestType": "SaveDocuments",
    "status": "P",
    "version": "v0.1",
    "validationReport": null,
    "dataReport": [
        {
            "locationGstin": "DSAJJ0AAGCR31",
            "locationName": "ABC MARKET",
            "documentNumber": "2947",
            "documentDate": "23-10-2020",
            "billFromGstin": "DDLDF07AAGCL",
            "supplyType": "S",
            "documentType": "LST",
            "portCode": null,
            "custom1": null,
            "custom2": null,
            "custom3": null,
            "custom4": null,
            "custom5": null,
            "custom6": null,
            "custom7": null,
            "custom8": null,
            "custom9": null,
            "custom10": null,
            "eInv": {
                "ackNumber": "1721101",
                "ackDate": "01-02-2021 18:54:00",
                "irn": "2d9a39998157b984276e6f1d3b8f74597d7850f0b7ba88c251556e4436b2bb0e",
                "signedInvoice": "CJWeJKYynrWOw2k-GLO-vDipfOohtqW1xh5bg",
                "signedQRCode": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjQe5VoYONjADbEYzGABzAz8cCyLXDfNENkZ_TXHw",
                "qrCode": "iVBORw0KGgoAAAANSUhEUgAAAG0AAABtCAYAAACrXCIc",
                "qrCodeData": "{\"SellerGstin\":\"abc\",\"BuyerGstin\":\"def\",\"DocNo\":\"234\",\"DocTyp\":\"ghi\",\"DocDt\":\"23/10/2020\",\"TotInvVal\":4005.00,\"ItemCnt\":4,\"MainHsnCode\":\"abc\",\"Irn\":\"321absd432\",\"IrnDt\":\"2021-02-01 18:54:00\"}",
                "errors": null
            },
            "propertyErrors": null
        }
    ],
    "referenceId": "abcdesf="
}

Find yourself a JSON aware editor, such as Visual Studio Code, or Google for any online JSON viewer and get into the habit of using these tools to check your JSON.

for example, https://jsoneditoronline.org/#left=local.taxoru&right=local.hucize gives this error with your JSON:

Parse error on line 3:
...", "qrCodeData": "{"SellerGstin":"abc","
-----------------------^

remove the first " after "qrCodeData": and you should be valid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM