users@wadl.java.net

Re: Wadl2java : duplicate function declaration

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 14 Apr 2008 15:03:50 -0400

On Apr 10, 2008, at 4:46 PM, DESPLAND Marc wrote:
>
> We use WADL to describe REST interface, and we try to use wadl2java
> to generate the client side
>
> we have problems with some of our WADL, there are 2 methods GET on
> the same ressource with differents parameters name, but with the
> same number and type (3 string in both cases)
>
> so the java generated code has the same methods defined twice ...
>
>
> Our WADL look compatible with the WADL Specification :
>
> "It is permissible to have multiple child method elements that have
> the same value of the name attribute for a
> given resource; such siblings represent distinct variations of the
> same HTTP method and will typically have
> different input data."
>
> So why wadl2java don't support them ?
>
An oversight.

> We modify wadl2java to use the id of the method (if it's set)
> instead of the name, that solves our problems but is it a good
> solution ?
>
That sounds like a good solution. The current method name generation
is based on the desire to reflect the uniform interface in generated
code (e.g. getXXXAsYYY) rather than something that could be perceived
as more RPC-like.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.