Skip to content

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

@cowtowncoder

Description

@cowtowncoder

(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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions