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":""}]"
}

When I parsed above JSONString using "http://jsonlint.com/", it gives me below error message. I am not sure what that error mean.

Please help me to get the right JSONString.

Error :

Parse error on line 2:
...sonStringData": " ["Coil",{"CHARGE_ID":"
-----------------------^
Expecting '}', ':', ',', ']'
1
  • { "jsonStringData": " [{"CHARGE_ID":"T862270","PROD_ID":"S878412", "COMBINE_SPLIT_IND":"S","WEIGHT":"353455","FEET":"3535","ORDER_NUMBER":"LI91004","OIL_DRY_IND":"D", "NEXT_FACILITY":"WHSE","DEFECT_CODE":"","TEST_CUT_IND":"","NSTD_FAC_REASON_CODE":"","COMMENTS":"", "SCRAP_FEET":""}]" } I have deleted First JSONArray called "Coil" from JSONString, but still getting the same error message. Parse error on line 2: ...onStringData": " [{"CHARGE_ID":"T862270" -----------------------^ Expecting '}', ':', ',', ']' Commented Dec 7, 2012 at 19:05

2 Answers 2

2

Remove the " after the : and also the closing one at the end.

{
    "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": ""
        }
    ]
}
Sign up to request clarification or add additional context in comments.

Comments

1

The quote just before Coil ends the string which was a value. Just after this string you should have either } or , :

enter image description here

(from json.org)

But it looks like the error was to put a json encoded array into quotes when building the complete object.

You should probably have

"jsonStringData": ["C...

instead of

"jsonStringData": " ["C...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.