0
{
    "jsonStringData": " ["Coil",{"CHARGE_ID":"T862270","PROD_ID":"S878412","COMBINE_SPLIT_IND":"S",
    "WEIGHT":"234244","FEET":"3535","ORDER_NUMBER":"LI91004","OIL_DRY_IND":"D",
    "NEXT_FACILITY":"WHSE",      "DEFECT_CODE":"","TEST_CUT_IND":"","NSTD_FAC_REASON_CODE":"",
    "COMMENTS":"","SCRAP_FEET":""}]"
}

当我使用“http://jsonlint.com/”解析上面的 JSONString 时,它给了我下面的错误消息。我不确定那个错误是什么意思。

请帮助我获得正确的 JSONString。

错误 :

Parse error on line 2:
...sonStringData": " ["Coil",{"CHARGE_ID":"
-----------------------^
Expecting '}', ':', ',', ']'
4

2 回答 2

2

删除"after the:和最后的关闭一个。

{
    "jsonStringData": [
        "Coil",
        {
            "CHARGE_ID": "T862270",
            "PROD_ID": "S878412",
            "COMBINE_SPLIT_IND": "S",
            "WEIGHT": "234244",
            "FEET": "3535",
            "ORDER_NUMBER": "LI91004",
            "OIL_DRY_IND": "D",
            "NEXT_FACILITY": "WHSE",
            "DEFECT_CODE": "",
            "TEST_CUT_IND": "",
            "NSTD_FAC_REASON_CODE": "",
            "COMMENTS": "",
            "SCRAP_FEET": ""
        }
    ]
}
于 2012-12-07T18:57:53.913 回答
1

前面的引号Coil结束了作为值的字符串。就在这个字符串之后,你应该有}or ,

在此处输入图像描述

(来自json.org

但看起来错误是在构建完整对象时将 json 编码数组放入引号中。

你应该有

"jsonStringData": ["C...

代替

"jsonStringData": " ["C...
于 2012-12-07T18:57:55.433 回答