Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: UNRESOLVED
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Deserializer
-
Labels:None
-
Number of attachments :
Description
Tatu, hello;
I am using mapper policy like one shown below;
what I am missing is @JsonMandatory annotation which would distinguish few fields in the bean which MUST be present for the deserializer to succed;(most other fields are already annotated with @JsonProperty and are optional)
or am I missing some hidden feature?
thank you.
Andrei.
#####################################################
@SuppressWarnings("deprecation")
public static void applyMapperPolicy(final ObjectMapper mapper)
I am not sure this is something Jackson should handle: that's what JSR-303 (Bean Validation API) is about. So this omission is deliberate.
But I am not against someone writing a module (and adding hooks it needs, if any, from core) that would offer such validation functionality.
In fact, using a JSR-303 implementation as the validator would make lots of sense. I just don't see this as something core or mapper should specifically implement.