Should return an array for multiple values #91

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

No description provided.

Owner

sporkmonger commented Nov 13, 2012

I think the bulk of this commit is good. I could be easily convinced that the right behavior is to return a hash containing a list when you have repeated values. I need to spend some more time with RFC 6570 to be really sure about this, but I think it's very reasonable. However, what I can't accept is the special treatment of square brackets. I've taken a hardline stance on this convention and I'm strongly against the use of this particular syntax. It is not advocated in any standards, and the fact that square brackets must be encoded in normal form leads to inelegant, error-prone code when trying to process them. It's a terrible way to solve something that has a much more obvious and vastly superior solution in the form of simple repeated parameters and flatter structures.

If you're going to use square bracket syntax, you need to include the brackets in the key value. I'm going to be exceedingly stubborn on this point.

I did restore the behavior until 2.2.8 which was more respectful of this RFC.
Why do I need to include the brackets in the key value? If I want an array, the key should be without.

If I let the brackets in the key value, then it will screw up a lot of framework including Rails

A lot of library rely onto addressable (oauth-provider2 for instance) I kinda agree with your point (square bracket) but it does exist, you can't just drop it

Owner

sporkmonger commented Nov 13, 2012

Nah, that kind of logic is what results in legacy software. I'm a firm believer in throwing away the stuff that sucks, compatibility be damned. And then following it up with lots of outreach to try to convince the rest of the world to stop doing things that suck.

sporkmonger added a commit that referenced this pull request Feb 4, 2013

sporkmonger added a commit that referenced this pull request Feb 4, 2013

sporkmonger added a commit that referenced this pull request Mar 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment