2005-05-09

Resedel

Well, here is Resedel (as in REstful SErvices DEscription Language), my entry in the replacing-WSDL sweepstakes. In keeping with the theme of this blog, and my general philosophy of designing programming languages, I have invented as little as possible, preferring to steal almost everything from the prior contributions of Tim Walsh (the RPC-style stuff) and Norm Bray (most of the rest).

6 comments:

Anonymous said...

I can't construct instances from schemas in my head. How about some examples? -Tim

Mike said...

The differences between create/update in a CRUD model and post/put in a REST model is confusingly conflated in this description language.

The CRUD model assumes the client knows the past state of the server and chooses create or update accordingly - clients send requests to perform a particular action.

The REST model does not assume the client knows the state of the server, but the client knows the desired state of the server - clients send requests to set the state of a resource.

Some SQL systems use 'upsert' to support clients managing data without needing to know the current state of the server - that operation is equivalent to 'put' in a REST model.

Wolf550e said...

It's Norm Walsh and Tim Bray, or is that some kind of in-joke?

John Cowan said...

Tim: The example is on its way. Naturally, I'm going to steal yours (and maybe Norm's too) and rewrite it.

Mike: I avoided using HTTP methods because sometimes you have to use POST to do what's underlyingly a read, for mechanical reasons to do with maximum URI lengths. I don't follow the distinction you're making here: can you explicate further to help me out?

wolf550e: Yes, it's a joke, and not even my joke. The credit goes to Jeff Rafter, when I told him I was looking to merge Tim and Norm (meaning their languages, of course).

Anonymous said...

Hi,

I think the abstraction between the operation (CRUD) and the HTTP method is not necessary. It can even become not best-practice HTTP. Like the other comment says: PUT is like InsertOrUpdate and POST is flexible to
make a partial update (for examle to update a collection by inserting an element). So I would prefer to directly declare the HTTP method to use instead of CRUD.

Olli

Thomas Steiner said...

Hi all,

Not sure whether this is of any interest now, anyway, I have tried to describe the Yahoo news search with Resedel. Probably there are some bugs in the description, however, given the rather minimalistic docs, I did what I could...


<?xml version="1.0" encoding="UTF-8"?>
<resedel version="0.2" xmlns="http://www.ccil.org/~cowan/resedel/ns">
<type id="Yahoo Search"
flavor="xsd"
href="http://search.yahooapis.com/ [...] /V1/NewsSearchResponse.xsd"
/>
<service id="News Search"
uri="http://search.yahooapis.com/NewsSearchService/V1/newsSearch"
operation="read"
>
<request soap="false">
<parameter name="appid" />
<parameter name="query " />
<parameter name="type" default="all" />
<parameter name="results" typref="xsd:integer" default="10" />
<parameter name="start" typeref="xsd:integer" default="1" />
<parameter name="sort" default="rank" />
<parameter name="language" />
<parameter name="site" default="" />
<parameter name="output" default="xml" />
<parameter name="callback" />
</request>
<response>
<language uri="urn:yahoo:yn">
<schema flavor="xsd" root="ResultSet" href="NewsSearchResponse.xsd" />
</language>
<fault name="Bad Req" status="400" />
<fault name="Forbidden" status="403" />
<fault name="Service Unavailable" status="503" />
</response>
</service>
</resedel>