Hacker News new | ask | show | jobs
by darrelmiller 4092 days ago
They thought about it...

"Some URI Templates can be used in reverse for the purpose of variable matching: comparing the template to a fully formed URI in order to extract the variable parts from that URI and assign them to the named variables. Variable matching only works well if the template expressions are delimited by the beginning or end of the URI or by characters that cannot be part of the expansion, such as reserved characters surrounding a simple string expression. In general, regular expression languages are better suited for variable matching."

1 comments

Oh yes, exactly! That was the note I was referring to obliquely. They're right, in a technical sense, but "wrong" (subjectively in some cases) when it comes to designing tools that work with URI Templates... It's absolutely a smart enough bunch of folks to get the tradeoffs, I just don't envy having to decide them. Even if, on this occasion, I may have argued more.

(Of course, a lot of standards, and this is one, are reflections, and unifications, of existing implicit standards. People had already started using some of these features, so they couldn't really drop them, and still see adoption. Not an easy balance!)