Constraints on numeric fields

#1

Similar to enum constraint on string fields is it possible to have constraints on numeric fields.
For example I would like to restrict a double field to positive values.

0 Likes

#2

Check the Constraint annotation (i.e. @constraint), it has a condition field that is a string I believe you can use it.
However the only use of this annotation that I could find is this one:

@constraint(required=false)
isEstimate: boolean
0 Likes

#3

Same question.
I see Ann.Constraint has a filter field.
Can that be used as forcing a field value in a numerical range, like a<x<b? What’s the syntax?

@DavidT ?

0 Likes

#4

@boaz.stossel I marked Ann.Constraint#filter as private @beta - requested feature is not currently supported; lets add a ticket for it.

0 Likes