Skip to content

Better optional properties with Jackson #455

@danielkaneider

Description

@danielkaneider

Hi,

I'm creating a follow-up of #250. The current possibilities still feel very limiting to me.

Current pain points

  1. Currently a primitive property is not considered as non-optional when using useLibraryDefinition
  2. It is not possible to use useLibraryDefinition and useSpecifiedAnnotations at the same time

How it should work

  • primitives such as int getNumber() should not be optional
  • all other objects eg String getText() should default to library
  • annotations specified (NonNull/Nullable) could overrule this

Suggestions

  1. Jackson2Parser line 229 should be rather !beanPropertyWriter.isRequired() && !beanPropertyWriter.getType().isPrimitive()
  2. It would be nice if there is a OptionalProperties.useLibraryAndAnnotations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions