Using ColdFusion 10, I created a struct and returned a JSON string after using SerializeJSON.
<cfreturn serializeJSON(stcResult)>
The string returned looks like this:
{"errors":[{"key1":"value1"},{"key2":"value2"}]}
I want the JSON to look something like the example below. How can I format it with different indentation levels, so it is more readable?
{
"errors":[
{"key1":"value1"},
{"key1":"value1"}
]
}
Thanks in advance.
I found a solution, just need to change '+' to '&' and change
' '
to ' ' or chr(32) when using CFSCRIPT.