Extra comma in json results when null column is the first one processed #25
I'm running into an issue when I output json and some of the fields in the select statement are null.
If any of those fields happen to be the first one, we get an extra comma in the output, and that means the result is not valid json.
To see an example of this, make the following modifications to the sakila database:
Update LangFilm.xml to be this:
Then, if you visit that resource:
you should see something like this:
That doesn't validate at jsonlint.org.
If you don't see this, column display order may be platform dependent, but if you remove the name field, you should definitely see the prepended commas.
The issue appears to be in
Proposed solution--use a json generation library: http://stackoverflow.com/questions/1668862/good-json-java-library rather than a hand crafted solution. Alternative solution: revamp the
The text was updated successfully, but these errors were encountered: