-
-
Notifications
You must be signed in to change notification settings - Fork 333
Add optional
property for @JacksonInject
to allow optionally injected values
#291
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
Add optional
property for @JacksonInject
to allow optionally injected values
#291
Conversation
src/main/java/com/fasterxml/jackson/annotation/JacksonInject.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/annotation/JacksonInject.java
Outdated
Show resolved
Hide resolved
Looks pretty good -- couple of small things but that's fine. Before merging this, one process thing: if I haven't asked for and gotten CLA, it is needed before merge: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf and the usual way is to print it, fill & sign, scan/photo, email to This only needs to be done once and CLA is good for all future contributions. Looking forward getting this & related PR merged! |
optional
property for @JacksonInject
to allow optionally injected values
CLA received. |
* | ||
* @since 2.20 | ||
*/ | ||
public OptBoolean optional() default OptBoolean.FALSE; |
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.
Actually I'll change default to OptBoolean.DEFAULT
.
As requested in jackson-databind#3072, introducing the
optional
flag to@JacksonInject
to avoid throwing an exception if an injected property is not found in the injectable values provided to the object reader: