dev@jersey.java.net

Re: mediatype attribute missing from representation element in generated WADL file

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 18 Jul 2007 12:21:22 +0200

Hi Ayub,

Fixed. As you can see from the attached commit, the information for
consuming was being used as the information for producing.

Paul.

Ayub Khan wrote:
> Hi Marc/Paul,
>
> I am using latest GF b55 with jersey 0.2. Using latest REST tooling
> source, I am seeing the following in generated wadl
> file.
>
> <application xmlns="http://research.sun.com/wadl/2006/10">
> <resources base="%%REPLACE%%/resources">
> <resource path="/customers/">
> <method name="GET">
> <response>
> <representation/>
> </response>
> </method>
> <method name="GET">
> <response>
> <representation/>
> </response>
> </method>
> ...
> instead of
>
> <application xmlns="http://research.sun.com/wadl/2006/10">
> <resources base="%%REPLACE%%/resources">
> <resource path="/customers/">
> <method name="GET">
> <response>
> <representation mediatype="application/xml"/>
> </response>
> </method>
> <method name="GET">
> <response>
> <representation mediatype="application/json"/>
> </response>
> </method>
> ...
>
> This is same for POST too.
>
> Attached is the application.wadl and the CustomerResource.java
>
> Thanks
> Ayub
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109

attached mail follows:



Author: sandoz
Date: 2007-07-18 10:17:39+0000
New Revision: 103

Modified:
   trunk/jersey/changes.txt
   trunk/jersey/src/tools/common/com/sun/ws/rest/tools/annotation/Method.java

Log:
fixed WADL generation mixing up produce/consume information when generating responses

Modified: trunk/jersey/changes.txt
Url: https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/changes.txt?view=diff&rev=103&p1=trunk/jersey/changes.txt&p2=trunk/jersey/changes.txt&r1=102&r2=103
==============================================================================
--- trunk/jersey/changes.txt (original)
+++ trunk/jersey/changes.txt 2007-07-18 10:17:39+0000
@@ -1,4 +1,6 @@
 release 0.2 (2007-xx-xx)
+- fixed WADL generation mixing up produce/consume information when generating
+ responses.
 - fixed WADL generation not correctly determining the HTTP method from
   @HttpMethod Java method name.
 - WebApplication.initiate can only be called once. Throw exception on subsequent

Modified: trunk/jersey/src/tools/common/com/sun/ws/rest/tools/annotation/Method.java
Url: https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/src/tools/common/com/sun/ws/rest/tools/annotation/Method.java?view=diff&rev=103&p1=trunk/jersey/src/tools/common/com/sun/ws/rest/tools/annotation/Method.java&p2=trunk/jersey/src/tools/common/com/sun/ws/rest/tools/annotation/Method.java&r1=102&r2=103
==============================================================================
--- trunk/jersey/src/tools/common/com/sun/ws/rest/tools/annotation/Method.java (original)
+++ trunk/jersey/src/tools/common/com/sun/ws/rest/tools/annotation/Method.java 2007-07-18 10:17:39+0000
@@ -58,7 +58,7 @@
     }
 
     public String getProduces() {
- return combineMimeTypeArray((produces != null) ? consumes : parent.getProduces());
+ return combineMimeTypeArray((produces != null) ? produces : parent.getProduces());
     }
 
     public void setProduces(String... produces) {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe_at_jersey.dev.java.net
For additional commands, e-mail: commits-help_at_jersey.dev.java.net