I received a specification of a RESTful service in json format and need to create a java api library for the client.
Now swagger can do it without a problem, but I would prefer to use cxf-wadl2java maven plugin. By default it doesn't expect the json format. See the exception cause stack trace below.
Is there a way to configure the cxf-wadl2java plugin to read json document?
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '{' (code 123) in prolog; expected '<' at [row,col {unknown-source}]: [1,1] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:653) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2133) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1181) at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1367) at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1261) at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1189) at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1178) at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1168) at org.apache.cxf.tools.wadlto.jaxrs.SourceGenerator.readXmlDocument(SourceGenerator.java:1757) ... 32 more
May be you can have two step conversion. swagger.json to wadl file and then use wadl2java plugin.
EDIT
There is a maven plugin provided by swagger.io. Please refer a usage example here