users@wadl.java.net

Re: How to describe primitive representations

From: Sergey Beryozkin <sberyozk_at_progress.com>
Date: Tue, 23 Feb 2010 15:46:59 +0000

> S.B : what if we have
> @Path("/")
> public class Resource {
> @PUT
> @Consumes("text/plain")
> @Path("id")
> public void setValue(@PathParam("id") long id, @QueryParam("somequery") int queryValue, Long value) {}
> }
>
> PathParam and QueryParam will be seen as method parameters with 'type' attribute such as "xs:long", etc. It does seem like
> plain text representations could have had some optional type information captured too, thus I was thinking about :
>
> <representation mediaType="text/plain">
> <param style="plain" type="xs:long"/>
> </representation>
>
Yes, I guess that would work.

S.B : ok

> or may be even better :
>
> <resource>
> <param type="xs:long" style="path" name="id"/>
> <method name="PUT">
> <request>
> <param type="xs:int" style="query">
> <param type="xs:long" style="plain">
> <!-- no representation element
> -->
> </request>
> </method>
> </resource>
>
I don't really like this one, the representation element is there to indicate that an entity body is expected and I don't think the
overloading of style="plain" buys you much except a few saved characters in the description.

S.B : agreed, having a representation-level parameter would actually be better.

thanks. Sergey

Marc.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_wadl.dev.java.net
For additional commands, e-mail: users-help_at_wadl.dev.java.net