I'm using ColdFusion 10's new REST API. Let's say I throw this exception:
<cfthrow errorcode="400" message="Validation error." type="ValidationException" />
ColdFusion handles exceptions well and returns this JSON in the response body:
{"Message":"Validation error.","Type":"ValidationException"}
Notice that the properties 'Message' and 'Type' are generated in Pascal Case (upper case first letter). For this to be consistent with everything else in my API, I need the properties to be Came Case (lower case first letter), such as the following:
{"message":"Validation error.","type":"ValidationException"}
Any idea how I can do this? I'm looking for a way to tweak the way ColdFusion generates the JSON without manually doing a cfcatch and generating the JSON myself.
<cfcatch>
it and return your own custom JSON string constructed from the exception's message and details.
I don't think you can tweak it unless you have the source from Adobe. :)