We're using Jackson JSON mapper in our code to de-serialize some configuration objects. We'd like for Jackson to fail on de-serialization when specific fields are missing or empty
The only feature in Jackson to support this behavior is for primitives :
final DeserializationConfig.Feature failOnPremitives = DeserializationConfig.Feature.FAIL_ON_NULL_FOR_PRIMITIVES;
The thing is the fields in question are mainly strings
Any help is highly appreciated
Have you considered Bean Validation?
While Jackson is focused in JSON parsing, Bean Validation is all about declaring and performing validation on your beans.
You could use @NotNull
or @NotBlank
from Hibernate Validator, the Bean Validation reference implementation.
Alternatively you could use JSON Schema.