Quantcast
Channel: Lucee Dev - Latest topics
Viewing all articles
Browse latest Browse all 464

Property default

$
0
0

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

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 464

Trending Articles