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

Preserving insertion order of keys on JSONObject #37

Closed
mombiela opened this issue Dec 13, 2011 · 2 comments
Closed

Preserving insertion order of keys on JSONObject #37

mombiela opened this issue Dec 13, 2011 · 2 comments

Comments

@mombiela
Copy link

Hello,

I know that JSON keys are unordered, but this make the transformation from JSON to XML unreliable, especially if you use xsd validation on the result. I suppose that some other formats are affected too.

I think that preserve the insertion order is a good improvement, with little impact on performance.

It should be as easy as replace java.util.HashMap with java.util.LinkedHashMap on JSONObject.

Thank you very much.
Joan

@douglascrockford
Copy link
Contributor

This has been tried. What happens is people make applications that depend on that ordering, which breaks interoperability.

@ygopala
Copy link

ygopala commented Nov 1, 2016

Is the order of JSON Array [] maintained when we convert from JSON to XML?

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