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
This is definitely a bug. I've added a bunch more tests and there are all kinds of issues with partial resolution of query string parameters. Not sure if I'm going to be able to resolve the issues without creating a DOM for the template. Doing a single pass of the template string doesn't provide a whole lot of flexibility when it comes to partial resolution.
This is probably already a known case, but to confirm, if you only provide a subset of the parameters, the unreplaced parameters remain, e.g. in the example above, if only active=true was provided, you end up with:
I was going to say I'd be happy to take a look at submitting a PR for this issue - but it sounds like from the comment above that you feel that resolving this properly would require a significant refactor - is that still the case? Would you be happy for me to take a look at resolving just this case?
@chrissimon-au Thanks for reminding me about this. The problem is that the algorithm to resolve URI templates is a simple one that is designed for speed, using a single pass. It was never intended to do partial resolution. I tried to retro-fit partial resolution and did a crappy job of it. If you have any ideas I'm open to suggestions.
Given a template such as: "http://test.example.org/customers{?active,country}" and setting resolvePartially to true:
When I add the active and country parameters, I would expect the output to be similar to: "http://test.example.org/customers?active=true&country=en-us"
Instead I am seeing a URL with a trailing curly brace:
"http://test.example.org/customers?active=true&country=en-us}"
The text was updated successfully, but these errors were encountered: