• Register
1 vote
720 views

Problem :

Can someone please tell me what is wrong with my code? I have tried almost everything and still unable to understand why my code keeps giving me below error:

Parse error on line 3: ...", "shortName": “Simple”, "longN

----------------------------------------------^

Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

 

My incorrect JSON is as below:

{
    "uuid": "133713371-d579-4d751-a5c5-8dfcfe110f621",
    "myshortName": “Simple”,
    "mylongName": “Simple”,
    "mycompanyName": “pjtnt11”,
    "versionCode": 1,
    "versionLabel": “1.7”,
    "watchapp": 
        {
            "watchface": true
        },
    "appKeys": 
        {
            "dummy": 0
        },
    "resources": 
        {
            "media": []
        }
}

 

6 5 3
7,540 points

1 Answer

0 votes

Solution  :

You must be using “ instead of " for many of the strings in your JSON. And those may not look like incorrect double-quote characters, but they are incorrect for JSON. Only the latter is valid in any JSON.

This generally happens to me when I try to paste the quotation marks from the another program, especially the office software which likes to make the quotes look as fancy as possible.

Your corrected JSON is as below:

{
    "uuid": "133713371-d579-4d751-a5c5-8dfcfe110f621",
    "myshortName": "Simple",
    "mylongName": "Simple",
    "mycompanyName": "pjtnt11",
    "versionCode": 1,
    "versionLabel": "1.7",
    "watchapp": {
        "watchface": true
    },
    "appKeys": {
        "dummy": 0
    },
    "resources": {
        "media": [

        ]
    }
}

 

9 7 4
38,600 points

Related questions

0 votes
1 answer 279 views
279 views
Problem : I am facing error “Expecting value: line 1 column 1 (char 0)” when trying to decode the JSON.The URL I use for a API call works fine in a browser, but gives above error when done through the curl request. The error happens at the return simplejson.loads(response_json)
asked Jan 20 jwilliam 3.9k points
0 votes
2 answers 4.9K views
4.9K views
Problem : I am trying to figure out the good way to load the JSON objects in the Python. I send below json data: {'http://example.org/about': {'http://purl.org/dc/terms/title': [{'type': 'literal', 'value': "Anna's Homepage"}]}} To my backend where it ... 1 column 2 (char 1)” I did lot of research on it but nothing seems to work for me. Any suggestions on my issue will be much appreciated.
asked Jan 7 alecxe 7.5k points
0 votes
1 answer 11 views
11 views
Can someone explain me why i am seeing this error that told me to use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $. How to solve it and what is reason behind this error?
asked Sep 14 Daniel Anderson 4k points
0 votes
1 answer 52 views
52 views
Problem: I have fundamental knowledge on java , json and gson. I have below method: public static Object parseStringToObject(String json) {     String Object = json;     Gson gson = new Gson();     Object objects = gson.fromJson(object, Object. ... strange error message: "com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1"
asked Aug 4 Raphael Pacheco 4.9k points
0 votes
1 answer 212 views
212 views
Problem : Currently I am trying to display a JSON content using a API key. But I am unable to get a authentication. I am facing below error in my JsonObject: “Org.json.JSONException: Value Authorization of type java.lang.String cannot be converted to JSONObject” In my ... to pass a API key and URL id to get my JSON response in a URL. I display a JSON content using a JSON array.
asked Feb 2 jwilliam 3.9k points