When I want the result of an expression to always be exported in json, I generally do this:
component accessors="true"{
property name="amount" type="Numeric" default="#this.calcAmount()#";
public Numeric function calcAmount() {
return 1+2+3;
}
}
The problem is that “amount” in the json is a string (with quotes) instead of a number.
Or is there a way to tell Lucee which methods to always serialize?
Some idea?
Many thanks.
OS: Linux
Lucee Version: 5.4