-
-
Notifications
You must be signed in to change notification settings - Fork 337
Add JsonInclude.Value
convenience constants
#314
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
Conversation
Equivalent to the enum values of JsonInclude.Include. See also discussion here: FasterXML/jackson-databind#5294
I think it's ok to just expose these particular constants without accessor. One process thing: I'd need CLA: https://github.com/FasterXML/jackson/blob/main/contributor-agreement.pdf (unless you have sent one in the past, if so, LMK). The usual way is to print, fill & sign, scan/photo, email to |
The constants specify the same JsonInclude.Include for inclusion of values both on Java object level, as well when contained in an object reference (e.g. an AtomicReference).
NOTE: CLA received. |
When referring to the instances of JsonInclude.Value, to avoid too much overloading with "values" referring to values being serialized to JSON. See also discussion: FasterXML#314 (comment)
JsonInclude.Value
convenience constants
* This will specify the same setting for including a value both | ||
* on <b>Java object level</b> as well as when <b>contained</b> | ||
* in an object reference (see {@link JsonInclude} for further | ||
* details on this distinction). |
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 makes sense & looks good. Thank you for doing this.
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.
LGTM
See discussion here: FasterXML/jackson-databind#5294
This pull-request adds some constants to
JsonInclude.Value
equivalent to the enum values ofJsonInclude.Include
.This e.g enables the following for configuring a JsonMapper:
I noticed a kind of established pattern in
JsonInclude.Value
to declarestatic final
constants asprotected
, and use a static method to access it. If this pattern is also applicable for these constants, just let me know, and I will edit the pull-request accordingly!