vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
922 stars 58 forks source link

`@NonNullApi` annotation is not used as defined in the annotation itself #787

Open cromoteca opened 1 year ago

cromoteca commented 1 year ago

Hilla uses @NonNullApi from Spring to make a package "not null" by default. This applies to everything in the package. But that annotation is thought to be applied only to method parameters and their return values: @TypeQualifierDefault({METHOD,PARAMETER}). For fields, there's the @NonNullFields annotation: @TypeQualifierDefault(FIELD).

cromoteca commented 1 year ago

Given that now we use properties to parse entities, @NonNullApi should cover all needs, as it applies to both endpoint methods and getters/setters. In case someone wants to use fields, we should support @NonNullFields to conform to Spring.