You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[v2] UriTemplate: {;...} path-style expressions are not recognized, and empty lists expand as if defined #3182
UriTemplate has two RFC 6570 gaps that the open URI template issues and PRs (prefix modifiers, explode, multi-variable, encoding, match decoding) do not cover:
getOperator() only recognizes +, #, ., /, ?, and &. In a path-style expression like {;lang,version}, the leading ; is kept as part of the first variable name (;lang), expand() drops the operator and any variable named lang, and match() captures the entire tail under ;lang.
In expandPart(), an empty array [] is treated as a defined value instead of undefined, so {/segments}, {?tags}, and {.list} still emit their operator prefix (and name= for ?/&) when given [].
What did you expect?
Per RFC 6570 §3.2.7 (path-style parameter expansion) and §2.3 ("A variable defined as a list value is considered undefined if the list contains zero members"):
I'd like to work on this. I've traced the issue to packages/core-internal/src/shared/uriTemplate.ts (missing ; operator and empty-list expansion). Could you assign this issue to me? I'll open a PR with tests against RFC 6570 examples.
Thanks @media-ctrl — the variable-name reading matches what I hit while implementing this: because getOperator did not accept ;, {;lang,version} was parsed as two names with ;lang, which is exactly the expand/match divergence you describe.
I have #3183 open against main with a patch for that: ; is now an operator (;name=value, ;name when the value is empty, and exploded lists repeating the name as ;name=v;name=v), plus one shared isUndefinedValue predicate (undefined or a zero-member array) applied at both the expansion and the match sites so the two directions cannot disagree about empty lists.
Tests are built from the RFC 6570 §3.2.7 example table ({;x,y}, {;x,y,empty}, {;x,y,undef}, {;list}, {;list*}, {;keys}, {;keys*}) plus the empty-array cases that used to expand to /, ?tags=, X. or X#.
If the fixture set you mentioned has cases mine miss, I'm glad to fold them in — a comment on #3183 (or a PR that extends the test table) works. I'm not assigned to #3182 yet; if a maintainer assigns it to someone else first I'll defer to them.
Activity
shhhhhhjokerist commentedon Nov 14, 2026
I'd like to work on this. I've traced the issue to packages/core-internal/src/shared/uriTemplate.ts (missing ; operator and empty-list expansion). Could you assign this issue to me? I'll open a PR with tests against RFC 6570 examples.
media-ctrl commentedon Nov 14, 2026
shhhhhhjokerist commentedon Nov 15, 2026
Thanks @media-ctrl — the variable-name reading matches what I hit while implementing this: because
getOperatordid not accept;,{;lang,version}was parsed as two names with;lang, which is exactly the expand/match divergence you describe.I have #3183 open against
mainwith a patch for that:;is now an operator (;name=value,;namewhen the value is empty, and exploded lists repeating the name as;name=v;name=v), plus one sharedisUndefinedValuepredicate (undefined or a zero-member array) applied at both the expansion and the match sites so the two directions cannot disagree about empty lists.Tests are built from the RFC 6570 §3.2.7 example table (
{;x,y},{;x,y,empty},{;x,y,undef},{;list},{;list*},{;keys},{;keys*}) plus the empty-array cases that used to expand to/,?tags=,X.orX#.If the fixture set you mentioned has cases mine miss, I'm glad to fold them in — a comment on #3183 (or a PR that extends the test table) works. I'm not assigned to #3182 yet; if a maintainer assigns it to someone else first I'll defer to them.