uriTemplateValueToTokens
private fn
string[] uriTemplateValueToTokens(const UriTemplateVarSpec spec, const UriTemplateValue value,
bool allowReserved) @safeConvert a value to expansion tokens for a given varspec.
This is an operator-agnostic core used by RFC 6570 expansion:
- Scalars yield one token.
- Lists yield either one comma-joined token (non-exploded) or one token per item (exploded).
- Maps yield either one comma-joined token of alternating key/value (non-exploded) or one token per
pair in key=value form (exploded).
Empty lists/maps are treated as undefined and yield zero tokens.
Parameters
spec | Variable specification (name + modifiers). |
value | Variable value. |
allowReserved | Whether to use reserved encoding (RFC 6570 `+` / `#`). |
Returns
Array of zero or more tokens.
Throws
UriTemplateException if an invalid modifier/value combination is used (e.g. :n on list).