Jakarta validation constraint with group not generated correctly in TypeScript

Hello, below you can find example code. Could you let me know if I have a done anything or wrong or this is a bug? I am using Hilla 25.3.0. Thanks!

Example.java

public class Example {
    @jakarta.validation.constraints.NonNull(groups = Group.class)
    String field;
}
Group.java

public interface Group {
}
Service.java

@BrowserCallable
public class Service {

    public void save(@org.springframework.validation.annotation.Validated(Group.class) Example example) {}
}

Generated TypeScript:

Example.ts

interface Example {
  field?: string;
}
ExampleModel.ts

...
    get field(): StringModel_1 {
        return this[_getPropertyModel_1]("field", (parent, key) => new StringModel_1(parent, key, true, { validators: [new NotNull_1({ groups: ["org.example.validation.Group"] })] }));
    }
...

And the model file has the following error:
TS2353: Object literal may only specify known properties, and ‘groups’ does not exist in type ‘ValidatorAttributes’.

Thanks for the report, could you please create a GitHub issue: Issues ¡ vaadin/flow ¡ GitHub

1 Like