jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

Allow overriding of FAIL_ON_MISSING_CREATOR_PROPERTIES

Open NikolayMetchev opened this issue 6 years ago • 5 comments

It would be useful to be able to override the FAIL_ON_MISSING_CREATOR_PROPERTIES functionality on a per property basis. Perhaps the most intuitive way would be to allow annotating properties with @Nullable and not complain if they are not specified. Alternatively respect the @JsonProperty(required=false) annotation.

As of version 2.9.8 I see no way of achieving this.

NikolayMetchev avatar Mar 29 '19 10:03 NikolayMetchev

I would also like to see this. In my code, most properties are required, and only on a few occasions I have an optional one. If I could turn on this option and then just annotate the handful of optional properties, instead of annotating all other properties as "required", I could remove a lot of the annotations!

So, it would be really good if required = false could be respected and would override this setting on a per-property level.

Blacklands avatar Jul 28 '20 17:07 Blacklands

Use of @Nullable won't be possible (would require a new dependency). Agree that there should be a way to change required-status.

cowtowncoder avatar Jul 15 '21 03:07 cowtowncoder