I have a ColdFusion component that will return some JSON data:
component
{
remote function GetPeople() returnformat="json"
{
var people = entityLoad("Person");
return people;
}
}
Unfortunately, the returned JSON has all the property names in upper case:
[
{
FIRSTNAME: "John",
LASTNAME: "Doe"
},
{
FIRSTNAME: "Jane",
LASTNAME: "Dover
}
]
Is there any way to force the framework to return JSON so that the property names are all lower-case (maybe a custom UDF/CFC that someone else has written)?
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. :/