[
https://issues.apache.org/jira/browse/CXF-6238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14307044#comment-14307044
]
Bertrand Renault commented on CXF-6238:
---------------------------------------
Hi Sergey,
I haven't had the time so far to test your first solution. I will test this new
solution (normally tomorrow). But I'm sure you've sorted out a solution that I
wouldn't have thought as my expertise in Java and this environment is really
minimal (say zero).
Don't be discouraged if I'm a bit slow... I've started to play with CXF as we
needed a way to retro document the new Rest API delivered in QA (without any
doc). We've selected CXF compared to Enunciate and other solutions...
Cheers,
Bertrand Renault
DGA SI - AIT - FMO - Méthodes (Site de Gradignan)
Bureau: A 203b Tél: 05 57 99 31 93
-----Message d'origine-----
De : Sergey Beryozkin (JIRA) [mailto:[email protected]]
Envoyé : jeudi 5 février 2015 11:31
À : RENAULT Bertrand-ext
Objet : [jira] [Commented] (CXF-6238) Java2WADL : Generating response status
attribute
[
https://issues.apache.org/jira/browse/CXF-6238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14306968#comment-14306968
]
Sergey Beryozkin commented on CXF-6238:
---------------------------------------
Hi Bertrand
I've thought a bit more about this annotation, it occurred to me it should
really have a Response.Status array as opposed to the primitive int type. The
declaration becomes a bit more verbose, but with a static import it looks quite
neat, and of course it is much more descriptive:
http://git-wip-us.apache.org/repos/asf/cxf/commit/d083c202
Hope you are OK with it
Sergey
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
> Java2WADL : Generating response status attribute
> ------------------------------------------------
>
> Key: CXF-6238
> URL: https://issues.apache.org/jira/browse/CXF-6238
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Affects Versions: 3.0.3
> Environment: JavaSE 1.7, JAX-RS 2.0
> Reporter: Bertrand Renault
> Assignee: Sergey Beryozkin
> Fix For: 3.0.4, 3.1.0
>
>
> 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.
> {code:title=resourceexample.java|borderStyle=solid}
> @GET
> @Path("/{id}")
> @Produces(MediaType.APPLICATION_JSON)
> @NoCache
> public Response getPermis(@PathParam("id") String id) {
> return Response.status(Status.NOT_IMPLEMENTED).build();
> }
> {code}
> The cxf-java2wadl-plugin configuration in the Maven Pom file
> {code:xml}
> <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>{code}
> The generated WADL file :
> {code:xml}
> <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>
> {code}
> Cheers,
> Bertrand.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)