-
Notifications
You must be signed in to change notification settings - Fork 21
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
Reserved expansion dictionary explode alternate ordering #58
base: master
Are you sure you want to change the base?
Reserved expansion dictionary explode alternate ordering #58
Conversation
They're specified as associative arrays, which is ordered:
|
6d98913
to
0b0907b
Compare
This is interesting. I appreciate that the wording of the RFC implies there is an ordering; however:
This second point is primarily the problem with my implementation: the built-in JSON parsing in Swift presents these variables as an unordered collection, and enumeration of the contents happens to differ from the order they appear in the file. I think a very common case is to provide an unordered collection of key/value and be ambivalent about the resulting ordering, eg URL query strings. I feel we should either:
Footnotes |
This can be removed if uri-templates/uritemplate-test#58 is merged
This can be removed if uri-templates/uritemplate-test#58 is merged
I faced the very same issue rolling an implementation with Go, more specifically, loading a Map from Json is not going to preserve the ordering: golang/go#27179 I'm in favor of:
But I'm open to hearing additional opinions. |
cc. @mnot have you had time to check this one further? |
This change brings these tests into line with those above by providing a list of acceptable expansions, one for each possible ordering of the exploded dictionary elements.
My implementation of RFC6570 (https://github.com/SwiftScream/URITemplate) happened to fail these due to it producing the alternate ordering.