English 中文(简体)
REST api ambiguity and WADL
原标题:
  • 时间:2010-04-01 17:59:20
  •  标签:
  • rest
  • wadl

I have a REST api that s ambiguous, something like (this isn t the specific problem, just gives an idea of the ambiguity):

/toplevel/${customer_number}/some_command/more stuff
/toplevel/${customer_number}/${some_product_name_anything_goes}/more stuff

We ve been getting away with it because our .htaccess file lists the more specific command form before the general ${product_name} version, and the first match wins. Now though, we re writing a WADL, and, as you might expect, we re having trouble with our chosen tool consuming the WADL, because the API is ambiguous. My questions are:

a) Does the WADL spec speak to whether they can validly represent ambiguous APIs?

b) Tool support - in your experience, do tools choke on ambiguous WADLs? (if ambi. WADLs are allowed then those are weak tools but, you d want to be on the safe side)

c) Just any experience with ambiguous REST apis, most especially wrt WADLs, really.

For the curious, here s the latest spec:

As far as I can tell it doesn t specifically address this, I guess it really comes down to how tools handle it.

问题回答

It is my experience that most people who are doing any serious amount of work in REST would prefer to use hypermedia for runtime discovery than using tooling and code gen against a metadata document.

It may be for this reason that you are not getting much input on your issue.





相关问题
Allow RESTful DELETE method in asp.net mvc?

im currently setting up asp.net to accept DELETE http verb in the application. However, when i send "DELETE /posts/delete/1" i always get a 405 Method not allow error. I tried to take a look at ...

Most appropriate API for URL shortening service

I ve just finished an online service for shortening URLs (in php5 with Zend Framework); you can enter an URL and you get an short URL (like tinyurl and such sites). I m thinking about the API for ...

Use HTTPClient or HttpUrlConnection? [closed]

We re implementing a REST client on JRE 1.4. Seems two good options for a client REST framework are HttpClient and HttpUrlConnection. Is there a reason to use HttpClient over the JRE s ...

Why can t I find the truststore for an SSL handshake?

I m using the Spring RESTTemplate on the client side to make calls to a REST endpoint. The client in this case is a Spring app and Tomcat is the servlet container. I m running into issues making a ...

Which Http redirects status code to use?

friendfeed.com uses 302. bit.ly uses 301. I had decided to use 303. Do they behave differently in terms of support by browsers ?

Three Step Buyonline The RESTful way

We are re-developing our buyonline functionality and we are doing it the RESTful way. The process is a three step one and the customer is asked to enter data at each step. Let s say the three URL s ...

热门标签