SerializeJSON(struct) on CF 2018 works differently than on CF 2016 and is breaking my code base.
On CF2016, when using SerializeJSON() to serialize a struct, string values like "true" would get converted to booleans in the JSON. While this could be considered a bug, serializeJSON() has always worked like this, and our code base (client side) is expecting the boolean value when deserializing the strings. Is there any way to enable the old behavoir for the entire app / server on CF 2018?
<cfset x = {}>
<cfset x.normal = true>
<cfset x.normalStr = 'true'>
// serialize and dump
<cfdump var="#serializeJSON(x)#">
// on CF2016, we get a boolean value for normalStr
{"NORMALSTR":true,"NORMAL":true}
// on CF2018, the data type is preserved
{"NORMALSTR":"true","NORMAL":true}
I know I can set the metadata to preserve data types, but my code base is to large to find all the various nested structs and keys that would need to have meta data description. I'm looking for a way to make CF2018 serializeJSON() work like it did on 2016.
I have also added a regex to replace "true" with true, within the resulting JSON, but this is not ideal and I haven't found all the places where this is causing issues.
Anyone know how to turn on the old behavoir of 2016?
Thanks!!
