1. Example - UriTemplate
-
Basics
- The simplest expansion
- A bit more
Chained Expansion
- Allows leaving the template in tact after adding a hostname
- And afterwards adding the rest of the params.
- You can drop unexpanded parameters.
Exploded and chained expansion
- Adds to the exploded var each call
Partially applied expansion issue
- Outputs incorrectly if unexpanded variables are kept
- Output correctly if unexpanded variables are dropped.
Handling variable types
- Label "{.xyz}" variables
- Fragment "{#id}" variables
- Path segment "{/id}" variables
- Path style param "{;id}" variables
- Query "{?id}" variables
- Query continuation "{&offset}" variables
- Reserved string "{+host}" variables
Variable lists
- Any type can have a list of variable slots.
Value lists
- Without explode "*".
- With explode "*".
- When path-style parameter list
Max Length
- You can provide max length "{?code:1}" (default is 10,000)
- Max Length needs to be before any explode
Special values
- Empty vars
- Undefined or null vars
2. Example - UriTemplateBuilder Spec
-
Basics
- The simplest thing.
- This really just appends stuff.