Sunday, 15 September 2013

jsonschema - How do I generate a JSON Schema using oneOf -



jsonschema - How do I generate a JSON Schema using oneOf -

i have been objects in system, , automatically generate schema them using code looks this:

objectmapper mapper = new objectmapper(); schemafactorywrapper visitor = new schemafactorywrapper(); seek { (class<?> annotatedclass : annotatedclasses) { mapper.acceptjsonformatvisitor(annotatedclass, visitor); jsonschema jsonschema = visitor.finalschema(); string schemastring = mapper.writerwithdefaultprettyprinter() .writevalueasstring(jsonschema);

i want restrict possible values of 1 of fields in 1 of annotatedclasses set of string values (for illustration 1 of {"one", "two", "three"} or similar. there annotation can set on field cause oneof restriction automatically generated in schema?

json jsonschema

No comments:

Post a Comment