Closed Thomasator closed 9 months ago
Hi @Thomasator,
In the existing standard modules, annotations related to XML structures are not considered for the generated JSON schema. That being said, it's certainly possible to configure those to be picked up. For your given example, refer to: https://victools.github.io/jsonschema-generator/#quot-required-quot-keyword You could adapt the given example to something like this:
configBuilder.forFields()
.withRequiredCheck(field -> Optional.ofNullable(field.getAnnotationConsideringFieldAndGetter(XmlElement.class))
.map(a -> a.required()).filter(required -> required).orElse(null));
Hi,
I am not able to get this tool to work to convert java classes (generated from xsd using xjc) and to get the required parametrs (@XmlElement(required=true) to json schema. Is this tool able to do this? Or is it possible to add it?
Thx for the responce Tomas