Closed mherb63 closed 9 years ago
JSON Schema has the ability to mark fields as required. This module supports this via the @JsonProperty(required = true) field annotation.
This is not working for me. My object has the following field:
@XmlAttribute(name = "clientRequestId", required = true) protected String clientRequestId;
and the generated output is :
"clientRequestId" : { "type" : "string" },
I'm using
<dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jsonSchema</artifactId> <version>2.5.1</version> </dependency>
Have you registered JAXB module? Otherwise Jackson does not make use of JAXB annotations, and can not propagate information (since it does not detect it) to schema generator.
Thanks, that fixed the issue.
JSON Schema has the ability to mark fields as required. This module supports this via the @JsonProperty(required = true) field annotation.
This is not working for me. My object has the following field:
and the generated output is :
I'm using