Is it possible to generate XSD from list of POJOs?

19 views
Skip to first unread message

Francesco Chicchiriccò

unread,
Jul 5, 2016, 12:51:15 PM7/5/16
to jackson-user
Hi all,

I was wondering how difficult could be to generate an XML Schema (XSD)
out of a collection of Jackson-annotated POJOs.

I have attempted using jackson-module-jsonSchema for obtaining a JSON
schema in first place, which could be translated somehow into XSD, but
could not figure out how to pass multiple classes to
acceptJsonFormatVisitor:

ObjectMapper m = new ObjectMapper();
SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
m.acceptJsonFormatVisitor(m.constructType(SimpleBean.class), visitor);
JsonSchema jsonSchema = visitor.finalSchema();

Any idea about this or any alternative approach possibly relying on
jackson-dataformat-xml?

FYI, I've initially started this discussion at [1].

TIA
Regards.

[1] https://github.com/FasterXML/jackson-dataformat-xml/issues/202

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC,
CXF Committer, OpenJPA Committer, PonyMail PPMC
http://home.apache.org/~ilgrosso/

Reply all
Reply to author
Forward
0 new messages