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

Separate required from nullability #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

almson
Copy link

@almson almson commented Dec 25, 2021

Validators like the Helm validator make a distinction between required and nullable properties. This makes sense.

This commit:

  • Allows primitive properties to be optional (they may have default values, eg when using @Jacksonized @Builder)
  • Allows nullable properties to be required (why not?)
  • Looks for javax.annotation.Nullable and org.jetbrains.annotations.Nullable properties
  • Adds config option to treat all reference properties as nullable
  • If above is true, looks for javax.annotation.Nonnull and related javax.validation.constraints.

@jandree-netflix
Copy link

@mbknor can this get merged and a new version released with this change? It would be really valuable to have as way to override behavior of primitive properties.

@almson
Copy link
Author

almson commented Apr 30, 2022

@jandree-netflix This is already implemented in my Java-based fork. If there's interest, then I'd love to maintain it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants