A resource function must have a single ''Path Annotation''. It will be called if a URL matches the path segments and templates specified as argument. ''Path templates'' contain variables in curly brackets, and map path values to arguments of the function. The following example represents a path annotation with three segments and two templates:
<pre class="brush:xquery">declare %rest:path("/a/path/{$with}/some/{$variable}") function($with, $variable) { ... };</pre>
<!-- TODO how matching works -->