How do you return lower-cased JSON from a CFCin ColdFusion?

Yeah, unfortunately, that is just the way ColdFusion works. When setting some variables you can force lowercase, like with structs:

<cfset structName.varName = "test" />

Will set a the variable with uppercase names. But:

<cfset structName['varname'] = "test" />

Will force the lowercase (or camelcase depending on what you pass in).

But with the ORM stuff you are doing, I don't think you are going to be able to have any control over it. Someone correct me if I am wrong.


From http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_s_03.html
Note: ColdFusion internally represents structure key names using all-uppercase characters, and, therefore, serializes the key names to all-uppercase JSON representations. Any JavaScript that handles JSON representations of ColdFusion structures must use all-uppercase structure key names, such as CITY or STATE. You also use the all-uppercase names COLUMNS and DATA as the keys for the two arrays that represent ColdFusion queries in JSON format.

If you're defining the variables yourself, you can use bracket notation (as Jason's answer shows), but with built-in stuff like ORM I think you're stuck - unless you want to create your own struct, and clone the ORM version manually, lower-casing each of the keys, but that's not really a great solution. :/