Define a client-side function odata.fillUriTemplate that takes two or more arguments.
The first argument MUST be of type String and specifies the URL template, the other arguments MUST be LabeledElement expressions that specify the template parameter name and evaluate to the template parameter value.
RFC6570 defines three kinds of template parameters: simple values, lists of values, and key-value maps.
Simple values are represented as LabeledElement expressions that evaluate to a single primitive value. The literal representation of this value according to ODATA-ABNF is used to fill the corresponding template parameter.
Lists of values are represented as LabeledElement expressions that evaluate to a collection of primitive values.
Key-value maps are represented as LabeledElement expressions that evaluate to a collection of complex types with two properties that are used in lexicographic order. The first property is used as key, the second property as value.
Define a second client-side function odata.uriEncode that takes one argument of primitive type and returns the URL encoded literal that can be used as a key value in OData URLs or in the query part of OData URLs.
Example:
In case you KNOW that there are no special characters in Genre names:
<Apply Function="odata.fillUriTemplate">
<String>http://odata.netflix.com/v2/Catalog/Genres('
{genreName}')</String>
<LabeledElement Name="genreName" Path="NameOfMovieGenre" />
</Apply>
Example:
If you want to be on the safe side:
<Apply Function="odata.fillUriTemplate">
<String>
http://odata.netflix.com/v2/Catalog/Genres('{genreName}
')</String>
<LabeledElement Name="genreName">
<Apply Function="odata.uriEncode" >
<Path>NameOfMovieGenre</Path>
</Apply>
</LabeledElement>
</Apply>
We also need to make sure we reserve odata. for names of apply functions.
Accepted: https://www.oasis-open.org/committees/download.php/48411/odata-meeting-27_on-20130228-minutes.html#odata-257