-
Notifications
You must be signed in to change notification settings - Fork 136
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
Optional Support #122
Comments
I am not sure how this is related to what this module does, JSON Schema generation? |
JSON Schema generation will have a required field set to true or false. If this is settable based on whether the POJO contains an Optional, that would be amazing. For example: {
"type": "object",
"properties": {
"street_address": { "type": "string" },
"city": { "type": "string" },
"state": { "type": "string" }
},
"required": ["state"]
} Would produce the pojo public class Example {
Optional<String> streetAddress;
Optional<String> city;
String state;
} Does that explain this better? |
@yehudacohen Yes, that helps. Now, I was under impression that Which version have you tried this with? Just want to verify that behavior you see is the latest one with 2.8.6. |
I'm looking for this feature (generate Optional generic) as well to be able to differentiate between a field which is set to null (default initialized) and not sent (optional). |
At this point I would need to know exactly what THIS module would need to do differently. |
Would be great if there was a way to configure this to serialize / deserialize json schema fields using Java 8 Optionals, so that fields of type T with required=false are deserialized to Optional and fields with required=true are deserialized to T rather than needing to use @JsonAttribute annotations.
The text was updated successfully, but these errors were encountered: