uritemplate icon indicating copy to clipboard operation
uritemplate copied to clipboard

Default values

Open plinss opened this issue 5 years ago • 5 comments

I noticed the implementation allows specifying default values in the template, which is cool, but is not supported by the RFC.

Maybe this feature should be added to the RFC?

plinss avatar Jan 24 '20 19:01 plinss

Can you share what you mean by "specifying default values"? I can't figure out what you're talking about. I only wrote things according to the specification.

sigmavirus24 avatar Jan 24 '20 22:01 sigmavirus24

Sure, you can have a template: “{foo=bar}” and if the caller does not provide a value for ‘foo’, the result is “bar”. Maybe I’m missing something but I don’t find that in the RFC.

plinss avatar Jan 25 '20 00:01 plinss

Huh, now I'm wondering why I implemented that nearly 7 years ago.

sigmavirus24 avatar Jan 25 '20 16:01 sigmavirus24

Looks like it was in an earlier draft: https://tools.ietf.org/html/draft-gregorio-uritemplate-02#section-3.2 and removed in version 06.

Don't get me wrong, I'm not proposing you remove the feature, I'd rather see a new version of the RFC that brings this feature back. I'm just pointing it out to raise the disconnect.

plinss avatar Jan 25 '20 17:01 plinss

Well I don't have control over that and have little enthusiasm to interact with the IETF WG over this.

sigmavirus24 avatar Jan 25 '20 23:01 sigmavirus24