uri templates: {?var}

It is great to see some more progress on URI templates <draft-gregorio-uritemplate-05>. Thanks Roy.

1.
The form-style query expansions {?var} needs to substitute '?' or '&' based on whether or not a '?' already appears in the URI output string being constructed. The text about the '?' operator in 1.1 "Overview" isn't clear on this point. It says '?' is used for the first variable with a defined value in the expression. This is true for the specific example used in the overview, but not true in general (when a template might have some query parameters as literals).

Suggested text:

  http://www.example.com/foo{?query,number}
                            \_____________/
                              |
  For each variable in ['query', 'number'] that has a defined value:
  substitute "?" or "&"; the variable name; "="; and the variable's
  value. The initial character substituted is "?" if, and only if,
  no "?" is already present in the URI output string being built.


--
James Manger

Received on Wednesday, 13 July 2011 14:17:45 UTC