I'm using JAX-RS to create a WADL file. The main problem is that when using a complex type (Ergebnis) in the generated WADL file the details of the request are missing. When i change the complex types Ergebnis and Anfrage in simple types like String the output is as expected. My code can be seen below.
I had to massively reduce my code to describe my problem concise. Hopefully i didn't mess up and type some mistakes in it. I hope someone can help me.
@POST
@Path("/testpfad")
@Produces(MT_JSON)
@Consumes(MT_JSON)
@Descriptions({ @Description(value = "Testbeschreibung", target = DocTarget.METHOD) })
Ergebnis testMethod(@NotNull Anfrage anfrage)
@XmlRootElement
@Doc(value = "Beschreibung")
public class Ergebnis {
@Doc("Beschreibung")
private boolean test
public boolean isTest() {
return test
}
public void setTest(final boolean test) {
this.test = test
}
}
Anfrage is looking similar to Ergebnis.
Generated WADL file:
<application>
<grammars>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
<xs:element name="Anfrage" type="Anfrage"/>
<xs:element name="Ergebnis" type="Ergebnis"/>
<xs:complexType abstract="true" name="Anfrage">
<xs:sequence>
<xs:element name="test" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:complexType abstract="true" name="Ergebnis">
<xs:sequence>
<xs:element name="test" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</grammars>
<resources base="http://localhost:8080/test">
<resource path="/">
<resource path="testpfad">
<method name="POST">
<doc>Beschreibung</doc>
<request>
<representation mediaType="application/json"/>
</request>
<response>
<representation mediaType="application/json"/>
</response>
</method>
</resource>
</resource>
</resources>
</application>