Re: URI and IRI Templating (What did I get myself into?)

Hi Joe,

I don't see this as a problem but more as a feature. In some cases, an 
application will want the first behavior and in other cases the second 
one. Why should the spec enforce one approach over the other when both 
are valid?

I have recently revised the Restlet support for URI template (for both 
formatting and parsing) to better align it with the current RFC draft:
http://www.restlet.org/docs/api/org/restlet/util/Template.html

As you can see, I have added the ability to describe each template with 
the following properties:
  - defaultValue
  - type (URI_SEGMENT, URI_UNRESERVED, etc.)
  - isFixed
  - isRequired

This is an approach similar to WADL parameters (which have a 'style' 
attribute).

IMHO, there would still be a lot of value in the RFC, despite fully 
leaving the encoding responsibility to the application. It would also 
keep it simple which is one of its design goals.

Thanks,
Jerome


> If you leave it up to the application you
> end up with the following situation:
> Given the template:
> 
>    http://bitworking.org/{path}
> 
> and
> 
>   path = "projects/httplib2/"
> 
> then application A interprets this as:
> 
>   http://bitworking.org/projects/httplib2/
> 
> and application B interprets it as:
> 
>   http://bitworking.org/projects%2Fhttplib2%2F
> 
> Those are two completely different URIs, only one of
> which will work. Following this would create a spec
> that provided no utility.
> 
>   -joe

Received on Tuesday, 26 December 2006 16:14:45 UTC