Retain sort order if object is an instance of SortedMap#91
Retain sort order if object is an instance of SortedMap#91uklimaschewski wants to merge 1 commit intostleary:masterfrom
Conversation
|
JSON keys are unordered. If you fix the order, then you may introduce interoperability problems. |
|
This pull request does not "fix" the order, it retains the order of already sorted maps. It indroduces in no way interoperability problems. |
|
If a consumer assumes a particular order, then you have introduced an interoperability hazard. Consumers will only assume such an order if you guarantee such an order. |
|
If the consumer does not assume a particular order, then it does not matter to him if there is a particular order or not. So there is no interoperability hazard, because this pull request is not the consumer. |
|
I agree with uklimaschewski. Keeping the order does not contradict that the order "may" change. |
|
You are free to express that opinion, but the reality is that if there is an observed order, some applications will depend on that order. We saw this is JavaScript, where a strictly compliant implementation may cause some applications to break. I don't want to make that same mistake here. |
Retain the original sort order, if converting from a SortedMap instance