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

Pretty seems to be sorting keys?!!? #837

Closed
aaronweatherall opened this issue Dec 4, 2014 · 1 comment
Closed

Pretty seems to be sorting keys?!!? #837

aaronweatherall opened this issue Dec 4, 2014 · 1 comment
Labels

Comments

@aaronweatherall
Copy link

Hey guys, I'm trying to track down an issue regarding the 'pretty' view of json data. I can't seem to figure how this could be an issue on my end.

Here's some example output from the RAW view.

"facets":[{"name":"Size","param":"size","display":true,"search":"facet_size","combine":"AND","weight":100,"values":{"AU 0":{"name":"AU 0","key":"AU 0","count":3},

As you can see, the first key is AU 0. Here's the output from the 'pretty' view

"name": "Size",
"param": "size",
"display": true,
"search": "facet_size",
"combine": "AND",
"weight": 100,
"values": {
"1": {
"name": 1,
"key": 1,
"count": 3
},

It seems to be doing a natural sort based on the keys?!?

@abhijitkane
Copy link
Member

This seems to be a side-effect of the JSON parser that we're using. Order of object properties isn't guaranteed in JS - http://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order

@a85 a85 closed this as completed Dec 23, 2014
@a85 a85 added the bug label Feb 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants