tracker issue : CF-4198419

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

string 'yes' converts to true when using serializeJSON() even when using javaCast('string','yes'))

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): Bill Reese / Bill Reese ()

Created: 03/21/2017

Components: Language, Serialization

Versions: 11.0

Failure Type: Data Corruption

Found In Build/Fixed In Build: CF11 Latest HF /

Priority/Frequency: Normal / All users will encounter

Locale/System: / Platforms All

Vote Count: 0

Problem Description:
string 'yes' converts to true when using serializeJSON() even when using javaCast('string','yes'))
Steps to Reproduce:
o = {
    'bad': 'yes',
    'worse': javaCast('string','yes')
};
j = serializeJSON(o);
writeOutput(j);
Actual Result:
{
    'bad': true,
    'worse': true
}
Expected Result:
{
    'bad': 'yes',
    'worse': 'yes'
}
Any Workarounds:
None that should have to be done.

Attachments:

Comments:

Why has this been withdrawn as designed? This is a really annoying issue. It shouldnt convert string to other datatypes.
Comment by Toby W.
1050 | March 24, 2017 11:48:25 AM GMT
Hi Toby (and whoever filed this ticket), This issue is fixed in CF2016 Update 2, which added StructSetMetadata() and StructGetMetadata() per ticket https://tracker.adobe.com/#/view/CF-3337394. Thanks!, -Aaron
Comment by Aaron N.
1051 | March 30, 2017 07:43:25 AM GMT
What about CF11? :(
Comment by Toby W.
1052 | April 25, 2017 02:45:52 PM GMT