How can I prevent SerializeJSON from changing Yes/No/True/False strings to boolean?

后端 未结 6 603
失恋的感觉
失恋的感觉 2020-12-20 12:19

I have a data struct being stored in JSON format, converted using the serializeJSON function. The problem I am running into is that strings that can be boolean in CF such as

6条回答
  •  情话喂你
    2020-12-20 12:46

    I believe that your or any similar "string forcing" workaround is the only possible way to prevent such behavior in Adobe CF for now.

    BTW, Railo works as expected with your example. Here is the output:

    Yes
    {"STR":"Yes"}
    Yes 
    

    It is also works same way for the numbers with trailing zeros.

提交回复
热议问题