Friday, January 11, 2008 10:37 AM rrobbins

JSON Syntax Checker Tool

Yesterday I found a useful tool for checking the syntax of JavaScript Object Notation strings: http://www.raboof.com/Projects/JsonChecker/ I needed that because I'm trying to create a widget for Stickam that will work in my compiled help file. I'm using my xml2json generic handler to convert XML to JSON and apparently it generated some invalid JSON. This tool helped me to narrow down the location of the syntax error.

I need to make some improvements to my xml2json generic handler. First it needs to surround the JSON string with parentheses to prevent the infamous invalid label error. Second it needs to output the JSON string to a text file so I can debug errors caused by invalid syntax (trace listeners don't seem to work in generic handlers). And third it needs to use regular expressions to replace bad JSON syntax with an empty string. I should probably build in the JSON Checker code and return an error message about bad syntax.

I have come across the JavaScriptSerializer class in the System.Web.Script.Serialization namespace but it cannot serialize XML or DataSets.

Working with JavaScript Object Notation is currently quite painful. I think programmers need better tools for working with JSON. We need tools to check the syntax and visualize the data or objects it represents because JSON strings are very cryptic.

Filed under: , , , ,

Comments

# re: JSON Syntax Checker Tool

Friday, January 11, 2008 12:37 PM by Denny Ferrassoli

Hey Robert,

I used the JavaScriptSerializer class to serialize a DataTable into a JSON object. I did not implement a deserializer but it can be easily added. Here's the link to the code: www.dennydotnet.com/.../A-DataTable-Serializer-for-ASPNET-AJAX.aspx

It won't serialize a DataSet but if you extract the DataTables then it may be useful. Hope it helps and good luck with the xml2json - please consider sharing when you have a stable version!

# re: JSON Syntax Checker Tool

Tuesday, March 23, 2010 12:53 AM by Cian

Hello everyone. You cannot be mad at somebody who makes you laugh - it's as simple as that. Help me! It has to find sites on the: How long herpes outbreak. I found only this - <a href="www.solidariedadeacuba.org.br/.../HerpesOutbreak">herpes outbreak pregnancy</a>. Herpes outbreak, doubt can help evil burning lives and if you extremely have the time, the care will catch sooner. My &quot on that would not be that there boils to be sensitive assistant even filled for many sperm of handler and guide for causing to thank that, herpes outbreak. :rolleyes: Thanks in advance. Cian from Kyrgyzstan.

# re: JSON Syntax Checker Tool

Saturday, December 24, 2011 2:19 AM by beedotillie

must check <a href=coachbagsusa.livejournal.com/>coach bags usa</a>   and get big save   with low price

# re: JSON Syntax Checker Tool

Saturday, December 31, 2011 6:02 AM by beedoleigha

click <a href=chanelbagsforcheaps.weebly.com/>chanel bags for cheap</a>  , just clicks away   for more

# re: JSON Syntax Checker Tool

Wednesday, January 04, 2012 5:37 AM by beedorosalba

click <a href=dvd-to-nexu-sone.weebly.com/>dvd to nexus one</a>  for more   for less

# re: JSON Syntax Checker Tool

Wednesday, January 04, 2012 7:55 PM by puntyotis

view <a href=www.hermesbirking.net/cheap-hermes-birkin-bags-ezp-5.html>hermes birkin bags</a>  with low price   online

# re: JSON Syntax Checker Tool

Thursday, January 05, 2012 6:41 PM by icorsfranklin

must look at this <a href=chanelbagsforcheaps.weebly.com/>chanel bags for cheap</a>  for gift   for more detail

# re: JSON Syntax Checker Tool

Monday, January 09, 2012 3:03 PM by icorscody

order an <a href=newchanelbags2010.zoomshare.com/>new chanel bags 2010</a>  for less    to take huge discount

# re: JSON Syntax Checker Tool

Monday, January 16, 2012 6:20 PM by Bymndestiny

I am sure you will love   , for special offer <a href=legendsofcountry.org/.../index.php  suprisely

# re: JSON Syntax Checker Tool

Tuesday, January 31, 2012 7:25 PM by TowCoopy

click to view <a href=cheap-coach.weebly.com/>cheap coach</a>  for more detail

Leave a Comment

(required) 
(required) 
(optional)
(required)