I'd like to use Bean Validation but can't set any ...
# getting-started
w
I'd like to use Bean Validation but can't set any annotation on field when using primary constructor. When I create a property inside class body, annotations are added as
@field:
and validation works. But the one from primary constructor does not specify any target, and when specified
@field
explicitly it shows error. So how can you specify constraints here?
class User(@Min(0) id: Int)
(specified like this does not work)