views:

7334

answers:

11

I'm looking for a JSON editor that is able to do syntax checking and outline view.
Browser-based editors are not an option as they are clumsy for editing lots of local files. Eclipse plug-in would be ideal, but I would be happy with anything that works.

I found only two so far, those in Aptana Studio Pro and Spket IDE (both available as plug-ins for Eclipse). While they have decent outline views, their syntax checking doesn't catch most of the common errors (like missing commas or braces) which makes them almost useless.

+1  A: 

Use the JSONLint

Andreas Grech
It's a browser tool, and not a proper editor, just a validator.. So it doesn't really help much.
al4nis
+3  A: 

Since you don't want to use an online tool for understandable reasons, perhaps using JSLint in Eclipse as detailed here will suit your needs. I've not tried it myself so I cannot say whether or not it really works...but it sure seems like a reasonable approach.

Note that the posting is assuming Linux but you should be able to use the same approach with Rhino on Windows.

Update: It works fine in Windows (I just tried it). Note that the JSEclipse plugin is totally unnecessary. Also, you don't need to put jslint.js in your project, it can go anywhere you want.

To get it to work I just unzipped the Rhino distribution then setup the external tool as follows (of course changing the paths to match your environment):

Name:  JSLint
Location:  C:\Program Files\Java\jdk1.6.0_10\bin\java.exe
Working Directory:  ${workspace_loc}
Arguments:  -jar C:\tools\rhino1_7R1\js.jar C:\\tools\\jslint.js ${resource_loc}

I'm glad you asked the question as it this is actually quite handy for some of the work I do.

Manik
It's not ideal, but it solves my main issue with syntax checking. I think I'll use this in combination with one of those two tools until something better can be found... Thanks!
al4nis
+6  A: 

http://jsoneditor.appspot.com

+1  A: 

Since JSON is valid javascript, wouldn't a javascript editor do?

le dorfier
+4  A: 

Bit late in the day, but noticed this JSON Editor Eclipse Plugin.

https://sourceforge.net/projects/eclipsejsonedit/

A: 

I use hXXp://jsoneditor.net/, its an Adobe Air application. Very simple and works fine.

Ibn Saeed
A: 

JSON Pro Viewer is a pretty awesome JSON editor. It's also an Adobe AIR application that provides an outline view for JSON Documents. Unfortunately, it does not have the ability to do syntax checking before creating the outline. http://www.jsonpro.com/

Is jsonpro 13$ good? Because all the other sucks! Excuse my language, say stuff like that is really not my style. In this case it is really true, I really can find any decent editor for json. Some validators like JSONLint is okay, but they are not editors.
P-A
A: 

Take a look at this one: http://jsonpad.web.gg

It's also an Air App but it's free :)

cheers

Chris
A: 

Sry domain changed... and update came out yesterday! :D

http://www.jsonpad.co.cc

cheers

Chris
A: 

JSONPAD sucks, can't open firefox bookmarks.json

Xxx
A: 

Firefox makes an illegal comma character at the last entry in the array. Second: If you have JavaScript url as a json value my validator throws an error, that's right.. So if this is now an error by me or not...

But i'm working on a bigger update, after this i'll think about a setting where you define the validation level.

cheers Chris

Chris