Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@PositiveOrZero annotation should not make ts fields not-nullable #2826

Open
berndhopp opened this issue Oct 14, 2024 · 3 comments
Open

@PositiveOrZero annotation should not make ts fields not-nullable #2826

berndhopp opened this issue Oct 14, 2024 · 3 comments
Labels
bug Something isn't working hilla Issues related to Hilla Impact: Low Severity: Major

Comments

@berndhopp
Copy link

Describe the bug

The javadoc of @PositiveOrZero says that "null elements are considered valid.". However, the client side validation will not accept null fields.

image

Expected-behavior

Null values are being accepted on the client-side for fields that are annotated with @PositiveOrZero

Reproduction

Annotate a DTO-Field on the java side with @PositiveOrZero, then bind the client side representation of that field to an vaadin-integer-field in a form. Leave that field empty and call validate() on the binder. The empty value will not be accepted.

System Info

Windows 11, Java 22, Chrome

@berndhopp berndhopp added bug Something isn't working hilla Issues related to Hilla labels Oct 14, 2024
@cromoteca
Copy link
Contributor

cromoteca commented Oct 14, 2024

What Java type are you using for that field? Non-nullability can be triggered by using primitive types or by using @NonNullApi annotation in the package.

@platosha
Copy link
Contributor

Seems to be a bug in the form library.

@platosha
Copy link
Contributor

Might be caused by using NaN for internal representation of empty number field state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla Impact: Low Severity: Major
Projects
None yet
Development

No branches or pull requests

3 participants