Diablo® III

Response data order

I've notice the json strings that come back are in no particular order. Not that this should be any problem, but in case anyone is counting on responses being the same order all the time.

For example my first request gives back

"Attacks_Per_Second_Item" : {
"min" : 1.2999999523162842,
"max" : 1.2999999523162842
},
"Strength_Item" : {
"min" : 211.0,
"max" : 211.0
},
"Damage_Weapon_Min#Physical" : {
"min" : 112.0,
"max" : 112.0
},
"Damage_Weapon_Delta#Physical" : {
"min" : 94.0,
"max" : 94.0
},
"Durability_Cur" : {
"min" : 403.0,
"max" : 403.0
},
"Steal_Health_Percent" : {
"min" : 0.028,
"max" : 0.028
},
"Durability_Max" : {
"min" : 403.0,
"max" : 403.0
}

while the second request returned

"Steal_Health_Percent" : {
"min" : 0.028,
"max" : 0.028
},
"Durability_Max" : {
"min" : 403.0,
"max" : 403.0
},
"Attacks_Per_Second_Item" : {
"min" : 1.2999999523162842,
"max" : 1.2999999523162842
},
"Durability_Cur" : {
"min" : 403.0,
"max" : 403.0
},
"Damage_Weapon_Delta#Physical" : {
"min" : 94.0,
"max" : 94.0
},
"Strength_Item" : {
"min" : 211.0,
"max" : 211.0
},
"Damage_Weapon_Min#Physical" : {
"min" : 112.0,
"max" : 112.0
}
Reply Quote
These aren't JSON strings, they are JSON objects. The returned format is always the same. However, a JSON object is inherently unordered. As such, once you load it using whatever language you are using, it will lose its order.

I guess I should note we know it is an object due to the <name>:<value> pairs.

P.S. This is a good thing! Now you can reference the name to retrieve the value.
Edited by Exiled#1146 on 9/15/2012 6:26 PM PDT
Reply Quote
These aren't JSON strings, they are JSON objects. The returned format is always the same. However, a JSON object is inherently unordered. As such, once you load it using whatever language you are using, it will lose its order.

I guess I should note we know it is an object due to the <name>:<value> pairs.

P.S. This is a good thing! Now you can reference the name to retrieve the value.


Exactly. Just letting people know not to expect it to be in the same order. Not saying this is a problem in any way.
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]