<cfset myStruct = structnew()> <cfset myStruct.keyName = "I won't preserve this key's case!"> <!---- this will be all uppercase. Sad face 😦 -----> <cfoutput>#serializeJson(myStruct)#</cfoutput>
<cfset myStruct = structnew()> <cfset myStruct['keyName'] = "I WILL preserve this key's case!"> <!---- this will preserve case. yay! -----> <cfoutput>#serializeJson(myStruct)#</cfoutput>
so even after sending that structure through serializeJson the case of key name in the second example is preserved. Hope this helps someone, cause I know it was driving me crazy for a while!