Closed wertzui closed 1 year ago
Thanks very much for reporting this and for the repro. We'll take a look!
Quick note verifying a repro.
I can verify that this is the current behaviour.
The reference implementation in Tavis.UriTemplates produces the same result with the equivalent code.
Tavis.UriTemplates.UriTemplate template2 = new("https://example.org/{?foo,bar}", true);
template2.SetParameter("foo", 42);
Console.WriteLine(template2.Resolve());
https://example.org/?foo=42bar}
There are no specs that validate this case.
It seems that there is no proper support for "new style" partial template resolution in Tavis.UriTemplates.
I have added some code which produces non-malformed URI templates, but it breaks the multivariable template up into components to deal with the possibility of missing items "in the middle" of the list.
Which I have accidentally pushed to main. Clearly the branch protection is not correct here!
I'll sort this out and issue a PR.
@wertzui Thanks for the bug report; can you have a look at the PR and validate that it "works for you".
When resolving one of multiple query parameters, the result is missing
{&
Results in
But should be