-
Notifications
You must be signed in to change notification settings - Fork 29
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
Order of JSON elements not same in Pretty and Raw view #72
Comments
Can you provide a url for this response? |
I'm afraid not. This service is on our company internal network. I will see if I can find a service that is exposed outside and having the same problem. |
No problem, we can just put it into a github raw file to test it |
You could try:
https://research.ibfd.org/custos/user
In the Pretty view the same happens. The order is not in sync with the Raw view (which is correct).
Op 18 aug. 2020 om 18:09 heeft Meng Li <[email protected]> het volgende geschreven:
No problem, we can just put it into a github raw file to test it
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#72 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGE7QNWIVYLZQWDC6YBHK7DSBKRS5ANCNFSM4QDWKTNA>.
|
Sorry for late reply.
The library |
Hi Meng Li,
It maybe that JSON says that an object is an unordered set of name/value pairs because for the meaning of the content it doesn’t make any difference. But for the human eye it does. It makes testing harder if a tool messes up your ordering and I don’t expect tools like yours to behave like this. The browser plugins that I know that make JSON pretty also do not do that. If you cannot or do not want to fix your tool then I have to abandon it and look for something that does respect my ordering.
Cheers,
Steef
Op 22 sep. 2020 om 15:10 heeft Meng Li <[email protected]> het volgende geschreven:
Sorry for late reply.
JSON definition says:
An object is an unordered set of name/value pairs.
http://www.json.org/
The library SwiftyJSON to analysis json, does not keep the order too.
It's hard to keep the original order, but we can sort it again by the order of alphabet.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#72 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGE7QNWXYDL6AYN7ISJDJ33SHCO43ANCNFSM4QDWKTNA>.
|
This project relies on |
The order in Pretty is wrong:
{
"product": {
"digest": "42d87a4e7abeb542a163f30e956b6db95c70a4b3ceb8200d46c6ca133ff9da50",
"priceUSD": 125,
"autoProcess": true,
"priceEUR": 105,
"mediaType": "Print",
"code": "030A16",
"cartEnabled": true,
"description": "Article 16 of the OECD Model Convention: History, Scope and Future",
"relatedItems": [
{
}, {
}
],
"isbn": "9789087223199",
"shippable": true,
"productType": "Book",
},
}
Raw:
{"product":{"code":"030A16","description":"Article 16 of the OECD Model Convention: History, Scope and Future","isbn":"9789087223199","priceEUR":105.0,"priceUSD":125.0,"productType":"Book","mediaType":"Print","relatedItems":["06DA16","06EA16"],"autoProcess":true,"cartEnabled":true,"shippable":true,"digest":"42d87a4e7abeb542a163f30e956b6db95c70a4b3ceb8200d46c6ca133ff9da50"}}
The text was updated successfully, but these errors were encountered: