-1
I’m running an application that reads a JSON result. I recently changed my server and noticed that the application stopped working. After several tests I found that my new server put quotes in some values, disabling the application.
To illustrate, I have the two results in JSON, one that works and one that doesn’t:
JSON - Works in the application [{"id":1,"start":"1413972000000","end":"1413979200000","title":"9,10,11,12","scheduling status":1,"userid":1,"name":"Test"}]
against:
JSON - Does not work in the application [{"id":"1","start":"1413972000000","end":"1413979200000","title":"9,10,11,12","scheduling"}]
I noticed the difference is only because of the quotation marks. Is there any way to standardize this?
How are you generating JSON? In fact, literal numbers are valid, the quotes around them are unnecessary.
– bfavaretto
What language are you using and in what code? Both of the examples you put up are valid: http://jsonlint.com/
– Sergio
I’m using Laravel to generate Json. The strange thing is that on one server it generates with quotation marks and on another it generates without quotation marks. The command to generate JSON is the same. As described here: http://laravel.com/docs/4.2/responses#special-Responses
– Felipe