jackson-module-kotlin icon indicating copy to clipboard operation
jackson-module-kotlin copied to clipboard

Take into account Java Optional when calculating the property's required marker

Open raderio opened this issue 6 years ago • 1 comments

class Data(val id: String, val email: Optional<String>)

email field is marked as required, but if we not pass data to it, it works correctly, it is initialized with Optional.empty.

Please mark Optional as non required.

raderio avatar Dec 26 '18 08:12 raderio

@raderio jackson deserializes null or lack of the value as Optional.empty because it logically means absent of value. What's wrong with that?

viartemev avatar Apr 29 '20 19:04 viartemev