jsonjsonlint

I am trying to Process a json file but while checking from JsonLint I get error Expecting 'EOF', got ','


Error: Parse error on line 12: ..."disliked": "true"}, { "liked": "true" ----------------------^ Expecting 'EOF', got ','

Json:

{ "liked": "true", "user_id": "101", "video_end_type": "3", "minutes_played": "3", "video_id": "101", "geo_cd": "AP", "channel_id": "11", "creator_id": "101", "timestamp": "07/05/2019 01:36:35", "disliked": "true" }, { "liked": "true", "user_id": "102", "video_end_type": "null", "minutes_played": "4", "video_id": "102", "geo_cd": "AP", "channel_id": "12", "creator_id": "102", "timestamp": "15/04/2019 17:04:00", "disliked": "true" }


Solution

  • You have an invalid JSON structure. There are two root elements and based on your JSON structure it appears that this is supposed to be a collection. Wrap your JSON structure in [] to make it a collection.

    [
       {
          "liked":"true",
          "user_id":"101",
          "video_end_type":"3",
          "minutes_played":"3",
          "video_id":"101",
          "geo_cd":"AP",
          "channel_id":"11",
          "creator_id":"101",
          "timestamp":"07/05/2019 01:36:35",
          "disliked":"true"
       },
       {
          "liked":"true",
          "user_id":"102",
          "video_end_type":"null",
          "minutes_played":"4",
          "video_id":"102",
          "geo_cd":"AP",
          "channel_id":"12",
          "creator_id":"102",
          "timestamp":"15/04/2019 17:04:00",
          "disliked":"true"
       }
    ]