Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more complicated variable names #3

Closed
hannesg opened this issue May 14, 2012 · 11 comments
Closed

Add more complicated variable names #3

hannesg opened this issue May 14, 2012 · 11 comments

Comments

@hannesg
Copy link
Contributor

hannesg commented May 14, 2012

Currently all variables are alpha-only. We could use some numbers, underscores, dots and pct-encoded characters ( see: http://tools.ietf.org/html/rfc6570#section-2.3 ).

@mnot
Copy link
Member

mnot commented May 17, 2012

Yes.

@damnhandy
Copy link
Contributor

I've started on a few tests over here:

https://github.com/damnhandy/uritemplate-test/blob/master/extended-tests.json

Is this kind of what you were thinking @hannesg ?

@hannesg
Copy link
Contributor Author

hannesg commented May 18, 2012

@damnhandy Yep, "last.name" and "Some%20Thing" are good examples.

@damnhandy
Copy link
Contributor

On second thought, I'm not so sure last.name is valid. Section 2.3 of the spec states:

     varspec       =  varname [ modifier-level4 ]
     varname       =  varchar *( ["."] varchar )
     varchar       =  ALPHA / DIGIT / "_" / pct-encoded

My ABNF skills are far from awesome, but if I read that correctly, the . isn't legal in a varname? Or am I just reading it wrong?

@mnot
Copy link
Member

mnot commented May 21, 2012

According to that, not legal.

Cheers,

On 21/05/2012, at 11:28 AM, Ryan J. McDonough wrote:

On second thought, I'm not so sure last.name is valid. Section 2.3 of the spec states:

    varspec       =  varname [ modifier-level4 ]
    varname       =  varchar *( ["."] varchar )
    varchar       =  ALPHA / DIGIT / "_" / pct-encoded

My ABNF skills are far from awesome, but if I read that correctly, the . isn't legal in a varname? Or am I just reading it wrong?


Reply to this email directly or view it on GitHub:
#3 (comment)

Mark Nottingham http://www.mnot.net/

@hannesg
Copy link
Contributor Author

hannesg commented May 21, 2012

Nope, is legal. You can read the spec as following:

A varspec is a varname optionally followed by a modifier-level4.
A varname is a varchar followed by a sequence of varchar each optionally preceded by ".".
A varchar is from ALPHA, DIGIT, "_" or pct-encoded.

It's legal but it may not be the first or last character.

@damnhandy
Copy link
Contributor

I think you're right @hannesg , I overlooked the quotes on ["."]. I thought it was optional string concatenation as in section 2.3 Like I said, my ABNF skills still need work ;)

@mnot
Copy link
Member

mnot commented May 21, 2012

argh, missed that, sorry; I should have looked more closely.

@hannesg
Copy link
Contributor Author

hannesg commented May 21, 2012

You're welcome ;)

@damnhandy
Copy link
Contributor

Making the fix...

@mnot
Copy link
Member

mnot commented May 21, 2012

Think we can close this for now (though there may be more...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants