Lucee 7 address some long standing annoyances with CFPROPERTY
<cfscript>
myCfc = new component accessors="true" {
property name="foo" type="string";
property name="bar" type="numeric";
property name="arr" type="array" default="#[1,2,3]#";
property name="st" type="struct" default="#{lucee:"rocks"}#";
foo = "hello";
bar = 42;
};
dump(myCfc); // See CFC object with properties
jsonString = serializeJson(var=myCfc, compact=false);
writeOutput(jsonString); // Output: {"foo":"hello","bar":42}
</cfscript>

1 Like