-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for basic "is-required" checks on deserialization using @JsonProperty(required=true)
#230
Comments
This would be really useful for us for generating JSON Schema. In JSON Schema properties are optional by default and need to be explicitly marked as required. |
As far as I know, this is already being used for schema generation. In fact, the only real use for the property. |
You are of course correct 😃 I've tested this with both the external json schema module and the jackson-databind schema generation and both respect the |
Some good news: #781 -- which adds support for required-ness for Creator methods -- has been implemented, and will be in 2.6. I hope it also helps figure out eventual general implementation for |
2.6.0-rc4 doesn't work for me. I've added |
Did you use this annotation on a constructor method ? |
thank you @walec51 . Constructor annotation did work for me. |
Do we have an update on this for class attributes? Been 1yr since last update. |
@utkarsh2012 If there is work we will update the issue. There is not much point in asking for things when there is no indication anything has changed. If you want to ask questions, in general, mailing list is a better place. |
(note: moved from https://jira.codehaus.org/browse/JACKSON-767)
As per title, although full validation of values is out-of-scope for Jackson, very basic "must be included in JSON" checks may fall in 80/20 line of things. Especially since we already have annotation to use.
The trick here is implementation; from two distinct parts:
BeanDeserializer
, and passing it; not trivial to do with current code.The text was updated successfully, but these errors were encountered: