-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Milestone
Description
public class Employee {
protected Date birthDt;
protected String name;
public Date getBirthDt() {
return birthDt;
}
public void setBirthDt(Date value) {
this.birthDt = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static void main(String[] args) throws Exception {
ObjectMapper mapper = new ObjectMapper();
JsonSchemaGenerator generator = new JsonSchemaGenerator(mapper);
JsonSchema jsonSchema = generator.generateSchema(Employee.class);
System.out.println(mapper.writeValueAsString(jsonSchema));
}
}
The code produces the JSON schema with redundant types for Date field.
{"type": "object", "properties": {
"name": {
"type": "string"
},
"birthDt": {
"type": "number",
"format": "UTC_MILLISEC",
"type": "integer"
}
}}
Metadata
Metadata
Assignees
Labels
No labels