Title:
Function SerializeJSON() converts employee's last name ("No") to boolean false in JSON output
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): James Partin / James Partin (James Partin)
Created: 09/26/2012
Versions: 11.0,10.0
Failure Type: Data Corruption
Found In Build/Fixed In Build: Final / CF11 Update4,CF10 Update16
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Win 2008 Server R2 64 bit
Vote Count: 13
Problem Description:
When using SerializeJSON() to convert objects to JSON, one employee has their last name of 'No' converted into a boolean false value, which breaks a lot of things.
I have tried javacasting as a string, placing in a cfc as a property with string type, always gets converted back to boolean false. There needs to be an optional flag for SerializeJSON() to ignore converting Yes/No strings to boolean values. I just finished getting the university to purchase ColdFusion 10 and this is killing me.
Steps to Reproduce:
Create a struct with one of the keys having the string value 'No'. run the struct through SerializeJSON()
Actual Result:
value is boolean false.
Expected Result:
value should be string "No"
Any Workarounds:
Currently appending "__" to every instance where I must use the employee's last name prior to serialization, then performing a Replace() to remove any occurrences of "__" in the result serialized JSON string
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3337394
External Customer Info:
External Company:
External Customer Name: Jim-sama
External Customer Email:
External Test Config: My Hardware and Environment details:
ColdFusion 10, Window 2008 x64
Attachments:
Comments: