raunaqmathur / google-visualization-java

Automatically exported from code.google.com/p/google-visualization-java
0 stars 0 forks source link

JsonRenderer creates malformed JSON #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create data table
2. Use JsonRenderer.renderDataTable
3. Parse with strict JSON library

What is the expected output? What do you see instead?

I get invalid JSON. The keys are unquoted and values are in single quotes.
Keys and values must both be in double quotes.

What version of the product are you using? On what operating system?

1.0.2

Please provide any additional information below.

Even google.gadgets.io.makeRequest errors on the JSON this class produces.

Attached file works better. I think we are still in trouble with the way a
Date is included.

Original issue reported on code.google.com by bill.ku...@gmail.com on 9 Sep 2009 at 5:42

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r48.

Original comment by shu...@gmail.com on 21 Dec 2009 at 3:04

GoogleCodeExporter commented 9 years ago
Reopening this issue after reverting the fix.

Moving to real JSON results in up to 10% increase in the response size, mostly 
due to
adding quotes to the keys.
In addition to that, since the GViz client already supports both the current 
format
and real JSON, the only reason to move to real JSON is to allow reading of the 
GViz
response by clients other than GViz client.

In light of the above, the right approach may be to keep the current format by
default, but add a tqx flag in the request that signals the server side to 
return
real JSON.

Original comment by shu...@gmail.com on 31 Dec 2009 at 5:01