FasterXML / jackson-module-jsonSchema

Module for generating JSON Schema (v3) definitions from POJOs
371 stars 135 forks source link

Required array attribute #94

Closed lordkada closed 8 years ago

lordkada commented 8 years ago

Hi, I'm trying to produce a schema with some required attributes annotating my pojo with @JsonProperty(required = true). My problem is that in the output I cannot find the "required" array attributes (only the required mark in each property). E.g:

my pojo

public class MyPojo { @JsonProperty(required = true) public String url; @JsonProperty(required = true) public String access_token; }

output schema

{ "type" : "object", "properties" : { "url" : { "type" : "string", "required" : true }, "access_token" : { "type" : "string", "required" : true } } }

Where am I wrong?

cowtowncoder commented 8 years ago

Excellent question for:

https://groups.google.com/forum/#!forum/jackson-user

My guess is that this could be JSON Schema v3 versus v4 difference, but I don't really know JSON Schema by heart.