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

Support use of Void valued properties (MapperFeature.ALLOW_VOID_VALUED_PROPERTIES) #2675

Closed
cowtowncoder opened this issue Apr 2, 2020 · 0 comments

Comments

@cowtowncoder
Copy link
Member

(note: offshoot of FasterXML/jackson-module-kotlin#314)

So. Looks like there is use case for something like:

public class VoidBean {
   public Void getValue() { return null; }

(and possibly reverse, to allow "setter"... that simply assigns null?)

especially since that may be needed for idiomatic usage by other JVM language like Kotlin and Scala.

The root cause for this not yet working is that both void keyword AND Void.class type are considered to mean "Does not return value", even though only first really does that.
Relaxing this (in AnnotatedMethod method hasReturnType() solves the serialization case and there is probably something relatively similar for deserialization as well.

Since this is a change to low-level code, however, it is probably best to consider this only for 2.12, and not yet 2.11.0 (due release soon).

cowtowncoder added a commit that referenced this issue Apr 2, 2020
@cowtowncoder cowtowncoder changed the title Support use of Void valued properties Support use of Void valued properties (MapperFeature.ALLOW_VOID_VALUED_PROPERTIES) May 7, 2020
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

No branches or pull requests

1 participant