Skip to content

[REQ][JAVA] Add @Nullable/@Nonnull annotations to POJO attributes and setters #19600

@nvervelle

Description

@nvervelle

I'm using java generator for webclient, and the generated POJO classes only contain @Nullable/@Nonnull annotations for the getters, but not for the attributes themselves or the setters.

When using tools like NullAway, it causes some issues because you cannot easily use the fluent setters when setting a nullable attribute, because the setter is not annotated with @Nullable.

I'd like to add the annotations to the attributes and the setters, so that it's easier to enable tools like NullAway on code using the generated clients.

I will submit a PR for this feature request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions