tracker issue : CF-3040210

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 80193:123 is serialized to 123

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Sean Corfield / Sean Corfield (Sean Corfield)

Created: 09/26/2009

Components: Language, Functions

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,0,251028 / 256226

Priority/Frequency: Minor / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 6

Problem:

123 is serialized to 123.0 in JSON (using the serializeJSON() function). This can cause problems for systems expecting literal values (such as the Transparensee search engine).The workaround is to add javaCast("int",value) all over the place which is ugly and, frankly, stupid. An integer should serialize to an integer!
Method:

Run this code:<cfset x = [ 123 ] /><cfoutput>#serializeJSON(x)#</cfoutput>Expected: [123]Actual: [123.0]
Result:

None, just a bad JSON serialization.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3040210

External Customer Info:
External Company:  
External Customer Name: Sean Corfield
External Customer Email: 479B4EDC43F3A88B992016B6
External Test Config: 09/26/2009

Attachments:

Comments:

This bug has been voted..
Vote by External U.
22798 | November 11, 2011 12:37:33 AM GMT
+1 vote. Definitely. CF has a habit of doing this sort of thing. I think <cfwddx> is the same, and possibly in QoQ in some situations. -- Adam
Vote by External U.
22799 | November 11, 2011 12:37:34 AM GMT
This bug has been voted..
Vote by External U.
22800 | November 11, 2011 12:37:35 AM GMT
This bug has been voted..
Vote by External U.
22801 | November 11, 2011 12:37:36 AM GMT
This bug has been voted..
Vote by External U.
22802 | November 11, 2011 12:37:38 AM GMT
This bug has been voted..
Vote by External U.
22803 | November 11, 2011 12:37:40 AM GMT