Details
Description
Would it be possible to get the WADL element attribute "status" be generated when using javax.ws.rs.core.StatusType interface and the Response builder ?
Here is the definition of the resource.
resourceexample.java
@GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) @NoCache public Response getPermis(@PathParam("id") String id) { return Response.status(Status.NOT_IMPLEMENTED).build(); }
The cxf-java2wadl-plugin configuration in the Maven Pom file
<plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-java2wadl-plugin</artifactId> <version>3.0.3</version> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-rs-service-description</artifactId> <version>3.0.3</version> </dependency> </dependencies> <executions> <execution> <id>parsejavadoc</id> <phase>generate-sources</phase> <goals> <goal>parsejavadoc</goal> </goals> </execution> <execution> <id>process-classes</id> <phase>process-classes</phase> <goals> <goal>java2wadl</goal> </goals> <configuration> <applicationTitle>APIREST</applicationTitle> <namespacePrefix>peTestCXF</namespacePrefix> <addResourceAndMethodIds>true</addResourceAndMethodIds> <linkAnyMediaTypeToXmlSchema>true</linkAnyMediaTypeToXmlSchema> <singleResourceMultipleMethods>false</singleResourceMultipleMethods> <classResourceNames> <classResourceName>fr.pe.internet.de.references.api.ressources.Permis</classResourceName> </classResourceNames> <!-- <classResourceNames/> --> <!-- <basePackages>fr.pe.internet.de.references.api.ressources</basePackages> --> <docProvider>org.apache.cxf.maven_plugin.javatowadl.ResourceMapJavaDocProvider</docProvider> <attachWadl>true</attachWadl> </configuration> </execution> </executions> </plugin>
The generated WADL file :
<application xmlns="http://wadl.dev.java.net/2009/02" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <doc title="APIREST"/> <grammars></grammars> <resources base="/"> <resource path="/permis" id="fr.pe.internet.de.references.api.ressources.Permis"> <resource path="/{id}"> <param name="id" style="template" type="xs:string"> </param> <method name="GET" id="getPermis"> <request> </request> <response> <representation mediaType="application/json"> </representation> </response> </method> </resource> </resource> </resources> </application>
Cheers,
Bertrand.