JSON differences in ColdFusion 9

Feb 09, 2010

Today I was trying to figure out a person's problem using my EventCalendar app on ColdFusion 9 and ended up finding an interesting difference between CF9 and older versions of ColdFusion. In the app, jQuery calls a CFC which returns a query dataset in JSON format. Here are the two different JSON returns for the same call to the same CFC.

When running in CF8

{"ROWCOUNT":1,"COLUMNS":["ID","TITLE","BODY","STARTTIME","ENDTIME","READONLY"],"DATA":{"id":["B434F6C3-D806-2328-29EA369C70E81CA5"||],"title":["rfrf"],"body":["erfer"],"starttime":["February 11, 2010 10:00"],"endtime":["February 11,|| 2010 13:30"],"readonly":[false]}}

And now in CF9

{"ROWCOUNT":1,"COLUMNS":["ID","TITLE","BODY","STARTTIME","ENDTIME","READONLY"],"DATA":{"ID":["B434F6C3-D806-2328-29EA369C70E81CA5"||],"TITLE":["rfrf"],"BODY":["erfer"],"STARTTIME":["February 11, 2010 10:00"],"ENDTIME":["February 11,|| 2010 13:30"],"READONLY":[true]}}
It's very slight but at the same time it was breaking my jQuery code. The column names in the CF return are in lowercase and in CF9 they're in uppercase. This was posted as a bug back in August 2009.


Adobe closed it without explanation, but it appears they feel it was more consistent the way CF9 returns the JSON. I can understand their point because the 'Columns' dataset is in uppercase and then is used in lowercase in the actual data. At the same time, I think this will probably burn a lot of people's time trying to figure out what is going wrong. Just fyi, that CF9's JSON returns may be slightly different from previous versions of ColdFusion.


Write your comment

(it will not be displayed)