Questions tagged [jsonlint]

JSONLint is a JSON linting (validation) and formatting tool.

JSONLint, which validates and formats files, is available as a browser based tool as well as a pure JavaScript version.

The latter can be integrated with or another server-side solution for command line usage.

It can also be integrated with any which supports JavaScript for development.

54 questions
0
votes
1 answer

Why does JSON.parse fail to parse this JSON string: `{ "Search results: \":s\"": "" }`?

Why does JSON.parse fail to parse the JSON string below? Is this not valid JSON? Strangely, https://jsonlint.com/ validates this string even though its custom JSON parser throws the same error as JSON.parse. JSON string { "Search results:…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
0
votes
0 answers

inputting json to my http request in Swift and getting errors, but perfectly valid in jsonlint.com

So my goal is to be able to trigger a notification without getting a NSCocoaErrorDomain error. Before this issue, I sent a notification to my single device using this json data in the http request: let paramString: [String : Any] = ["to" : token, …
0
votes
1 answer

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":…
0
votes
1 answer

cmd doesn't output results to a file

I'm trying to use the cmd line, eventually putting it into a .bat to run a program, taking the return value and putting it into a .txt file. In this script it runs the program, creates the .txt file, but the .txt file is blank, while the program…
0
votes
1 answer

Running "jsonlint test.json" from cmd (Command Prompt), returns ENOENT: no such file or directory, errno: -4058

I'm running this command "jsonlint test.json" from cmd (Command Prompt). It returns ENOENT: no such file or directory, errno: -4058. If I enter the text directly into https://jsonlint.com, it says valid. I don't think its not valid, just says it…
0
votes
0 answers

How to call a command over every .json file in a directory with different file extensions?

I am trying to write a npm script (bash) to run the command jsonlint -q over every .json file in a directory that contains files of other extensions. This is what I have so far, but it only works for the first json file in the directory. Different…
0
votes
1 answer

how to prettyprint a single-quoted JSON file using jq

{ 'abc': { 'name': 'John', 'address': 'USA' }, 'xyz': { 'name': 'Robert', 'address': 'Canada' } }
user8845768
  • 103
  • 3
  • 5
0
votes
1 answer

Javascript regex to parse JSON string with property values in html

i have data in the below format, is not a valid json and am trying to convert using regex, for details see this question which i've tried, but the parse won't go through. The problem is that the response string also contains html, var and trailing…
Salus Sage
  • 678
  • 3
  • 16
0
votes
1 answer

Error in JSON parsing using JSON.loads()

I'm reading a bunch of JSON lines from a file and getting an error while parsing them using json.loads(). The file was encoded using us-ascii, and I've tried utf-8, unicode, us-ascii, and utf-16 encoders in json.loads() but each time I get the same…
Dhruv
  • 952
  • 1
  • 11
  • 26
0
votes
1 answer

Mongodb retrieve correct json from geospatial query php

I'm tring to retrieve correct JSON from this code. $query = array( 'loc' => array('$geoWithin' => array('$centerSphere' => array(array($x,$y), 35 / 6371) ))); $cursor = $collection->find($query); // How many results found $num_docs =…
Motosega
  • 35
  • 2
  • 11
0
votes
2 answers

Error in parsing json Expecting '{', '['**

This is the json . "{ 'places': [ { 'name': 'New\x20Orleans, \x20US\x20\x28New\x20Lakefront\x20\x2D\x20NEW\x29', 'code': 'NEW' } ] }" I am getting json parsererror. I am checking on…
user1502901
  • 123
  • 1
  • 1
  • 14
0
votes
3 answers

Why is this JSON invalid?

{ "already_public": "null", "status": "true", "message": "Service provider added successfully", "detail": { "id": "1175", "address_1": "", "address_2": "", "profession": "Accountant", "city":…
Shahid Karimi
  • 4,096
  • 17
  • 62
  • 104
0
votes
1 answer

JSON unexpected token error (PHP json_encode & jsonlint.com)

{"cover":"http:\/\/files.domain.com\/some_file\/1234.jpg_thumb.png"} This is my JSON code and when I tries to parse, it returns Unexpected Token error. I checked on http://jsonlint.com/ but it didn't go well. I used php json_encode function to…
0
votes
3 answers

Invalid Json Error in JsonLint

I have a web service returning following json: [ { "id": "9469", "title": "A person grabbed by police because being Nigerian he was carrying a Ghanaian passport!", "introtext": "A person has grabbed by police because…
NightFury
  • 13,436
  • 6
  • 71
  • 120
0
votes
1 answer

FATAL ERROR: JS Allocation Failed - process out of memory

I'm trying to run jsonlint on a 40MB JSON file, but it halts execution with an exit status of 5, and the following error message: FATAL ERROR: JS Allocation Failed - process out of memory Does anyone know how I can get this JSON pretty-printed? I…
user3025492
  • 2,853
  • 4
  • 18
  • 19