Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@JsonProperty(required=true) not honored during Bean de-serialization #17

Closed
Yoztastic opened this issue Aug 14, 2013 · 1 comment
Closed

Comments

@Yoztastic
Copy link

I had hoped that annotation of a field with @JsonProperty(required=true) would cause an exception to be thrown during de-serialization if the field was missing from the Json.

But it appears to be ignored.

Is there a work around?

@cowtowncoder
Copy link
Member

No, this is only used for decorating JSON schemas, and deserializer does not make any use of it.
Since handling of annotations is implemented in databind, there is an RFE here:

FasterXML/jackson-databind#230

for possibly adding support; this has been requested, and although Jackson will NOT add general validation of input (that's what Java Bean Validation API is for), simple required check seems like a reasonable minimal check to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants