uriTemplateValueToTokens

private fnstring[] uriTemplateValueToTokens(const UriTemplateVarSpec spec, const UriTemplateValue value, bool allowReserved) @safe

Convert 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

specVariable specification (name + modifiers).
valueVariable value.
allowReservedWhether 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).