Open an API reference from 2007 and you can date it by its punctuation. One service asks for /users/{id}. The next wants /users/:id. A third, staffed by someone who had made peace with XML, insists on /users/<id>. Same idea every time: a URL with a hole in it, and a value that goes in the hole.

Every framework that ever served a page or an endpoint built that hole for itself, named it after its own tastes, and then spent a paragraph of documentation explaining the naming. The URI had a written syntax by 1994. The hole inside it waited until 2012.

In March 2012 the IETF published RFC 6570, URI Template, on the Standards Track. It defines "a compact sequence of characters for describing a range of Uniform Resource Identifiers through variable expansion", plus the algorithm that turns a template and a set of values into a real URI. It did not invent the placeholder. It did something harder and more useful: it wrote down what the web was already doing, gave the variations names, and turned a hundred private conventions into one public grammar.

The author list is a small piece of Internet history by itself: Joe Gregorio, Roy Fielding, Marc Hadley and Mark Nottingham. Fielding wrote the dissertation that gave the world REST; a dozen years later he helped write the grammar that lets a REST client fill in a link it has never seen.

A macro language with fixed macros

The sharpest sentence in the document is the one describing what the document is. URI Templates, it says, "are similar to a macro language with a fixed set of macro definitions" — and the operator sitting just inside the opening brace decides which expansion runs.

That is a deliberate refusal of the obvious temptation. A general-purpose templating language would have handed you conditionals, loops, filters and probably a conference. RFC 6570 hands you a closed list of operators, each with one exact expansion, so two implementations written by strangers in different languages can agree without sharing a line of code.

Four levels, from plain to powerful

The grammar climbs in four rungs, and the rungs are the interesting part.

Level 1 is the plain brace: {var}, replaced by the value, percent-encoded where it must be. Level 2 adds two operators with opinions — {+var} for reserved expansion, which keeps characters such as / and : exactly as given, and {#var} for fragment expansion. Level 3 adds the punctuation of real URLs: {.var} for a dot-prefixed label, {/var} for a path segment, {;var} for a path-style parameter, {?var} for a form-style query and {&var} for its continuation. Level 4 adds the modifiers that let the grammar survive contact with real data: {var:3} takes a prefix, and {list*} explodes a composite value into its parts.

The examples read like a poem of small decisions. {+path}/here with path set to /foo/bar yields /foo/bar/here — the slashes survive. {?q} with q set to hello world yields ?q=hello%20world — the space does not. {var:3} with var set to value yields val. {list*} with a three-item list yields red,green,blue.

Level 1 is an apology to the present

The most honest paragraph in the document explains why the first rung is so plain: "Since most template processors implemented prior to this specification have only implemented the default expression type, we refer to these as Level 1 templates."

Read that again as a design principle. The authors did not demand that the world adopt their richer idea. They described what the world already did, called it Level 1, and built the ladder above it so the next implementation had somewhere to climb. Adoption first, ambition second.

The one-character decision that saves your callback URL

Each operator answers a question an API author used to answer alone, and usually badly: is this value a piece of path, a query parameter, a fragment, or something that must keep its reserved characters — like a URL passed as data?

That last case is the quiet workhorse. Push a callback URL through {var} and its colons and slashes are percent-encoded into a paste of %3A and %2F. Push the same URL through {+var} and it arrives intact. The difference between a working redirect and a double-encoded mess is one character inside a brace — and RFC 6570 turned that character from a house convention into a rule.

Why a grammar for blanks matters

A human filling in a template needs an example. A machine needs the grammar: which part varies, what kind of value goes there, and how to check that what came back fits.

Once a template is machine-readable, a description of an API can carry the shapes of its own links, and a client can construct a request to a resource it has never seen. That is the whole trick behind hypermedia, and it is why RFC 6570 turns up in places that have nothing to do with braces: HAL's templated links, JSON Hyper-Schema's href, OpenSearch's URL descriptions, the LRDD discovery rules in Web Host Metadata. A small grammar for blanks, quietly holding up a large part of the web.

The lock-in hiding in plain sight

Here is the part the specification does not advertise. The property that made RFC 6570 win — a small, closed, exhaustively specified list of operators — is also the property that makes it a ceiling.

Four levels, fixed in March 2012. No conditionals. No loops. No arithmetic, no defaults, no optional segments. Anything the grammar cannot express has to live outside it, in the prose of the API document or in the client's own code. That is not a flaw in the design; it is the design. Interoperability and lock-in are the same coin, and the web has been spending it ever since.

Which is the real lesson of the brace wars, and it travels well beyond URLs. A standard that describes what running code already does gets adopted quickly, because nobody has to change anything. It also becomes very hard to replace, for exactly the same reason. The spec that wins is the spec that freezes.

A ceasefire with a publication date

RFC 6570 did not settle the argument about how to describe a URL with a hole in it. It ended the argument, which is a different and more useful thing. The braces stayed. The colons and the angle brackets went home. And every API that has ever handed a client a link template has been quietly speaking the grammar four people wrote down in March 2012.

A standard is not a solution. It is a ceasefire with a publication date — and this one has held for more than a decade.