-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow to fail on primitives in constructor with failOnNullForPrimitives=true
#881
Conversation
serde-api/src/main/java/io/micronaut/serde/config/DeserializationConfiguration.java
Outdated
Show resolved
Hide resolved
@@ -803,6 +817,7 @@ public static final class DerProperty<B, P> { | |||
.orElse(null); | |||
this.explicitlyRequired = annotationMetadata.booleanValue(SerdeConfig.class, SerdeConfig.REQUIRED) | |||
.orElse(false); | |||
this.explicitlyRequiredForConstructor = explicitlyRequired || argument.isPrimitive() && failOnNullForPrimitives; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.explicitlyRequiredForConstructor = explicitlyRequired || argument.isPrimitive() && failOnNullForPrimitives; | |
this.explicitlyRequiredForConstructor = explicitlyRequired || (argument.isPrimitive() && failOnNullForPrimitives); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Having trouble reading it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, no idea about the precedence rules for the logical operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like in math * / AND has a priority :D
…ionConfiguration.java Co-authored-by: Jonas Konrad <jonas.konrad@oracle.com>
Quality Gate passedIssues Measures |
Fixes #880