FasterXML / jackson-modules-java8

Set of support modules for Java 8 datatypes (Optionals, date/time) and features (parameter names)
Apache License 2.0
398 stars 116 forks source link

Implicit name provided by `ParameterNamesModule` overridden by "incomplete" `@JsonProperty` #301

Closed cowtowncoder closed 7 months ago

cowtowncoder commented 7 months ago

Looks like case like follows:

static class Bean {
   @JsonCreator
   public Bean(@JsonProperty(required=true) int id, @JsonProperty(required=false) String name) {
       // ...
   }
} 

fails with empty "name" (value attribute with default) masking implicit name that ParameterNamesModule provides. It shouldn't.

cowtowncoder commented 7 months ago

Actually, turns out this actually works: whether due to recent change in jackson-databind or not. Closing: leaving passing test to protect against regression.