How to define variable Resource such as /colours/{colour} in a WADL?

513 views Asked by At

Is it possible to define the fact that you are expecting a {colour} in the /colours/{colour} URL as part of a WADL? If so, how would you do it? If not, isn't this a huge oversight of the spec?

Why can't I do something like this to define /colours/{colour}:

    <resource path="colours" id="Colours">
      <resource id="colour" uri="{colour}">
        <method name="GET" id="get_colour"/>
      </resource>
    </resource>

Thanks in advance.

1

There are 1 answers

0
Simon On BEST ANSWER

Found the answer: http://cxf.apache.org/docs/jaxrs-services-description.html

You can define it as a param with a style of template, e.g:

<resource path="colours" id="Colours">
    <param name="colour" style="template" required="true"/>
    <method name="GET" id="get_colour"/>
</resource>