Closed osvaldopina closed 6 years ago
I'd rather not do this as it would break compatibility with other URI template processors. Keep in mind that a URI template is not a valid URI. It's a template. The -
is a reserved character and could be used in a future version of the spec, so it's not unreasonable that it could be used again. In which case, relaxing it would break compatibility. It had been used in earlier versions of the spec. Yes, it is annoying that you can't have variable names with a -
in it. There is a test negative test case that asserts this.
I've been re-thinking this as I've run into similar issues in my own work. It had me wondering about adding a non-strict mode, which could relax a few cases where the spec goes a bit too far.
@damnhandy, Would you still be willing to accept the creation of the non-strict mode?
Hi,
I was looking at template uri spec (rfc 6570) and I saw that the specification for variable name is:
but the spec for uri (rfc 3986) states that the valid queries are formed by:
So, the folloing template
{?var-name}
is invalid but the expanded query?var-name=var-value
is valid.What do you think about creating an option for relaxing template variable names to allow all valid uri query characters?