A faction has peace treaties : "peace": { "13129": 1495531145, "24884": 1475144866 } A faction does not have peace treaties: "peace": [ ] The first is an object (dictionary in this case), the second is an array. http://www.json.org/ This kinda screws with my json to object mapping ... I can do a work around, but this looks like a bug to me.
I believe a similar issue was reported before and deemed not to be a bug, but let me pass this to Chedburn to see if it can be fixed (easily)
I've made a quick change (Peace doesn't appear at all now). Perhaps that's better?
Hi Ched, { "ID": 36677, "name": "JRT", "leader": 1621492, "co-leader": 0, "best_chain": 29, "respect": 990, "rank": 1820, "peace": null, "members": { "660043": { "name": "Sinja", "days_in_faction": 2 }, "1621492": { "name": "StonedAndy75", "days_in_faction": 31 } }, "specials": { "chaining": 0, "vigor": 0, "enormity": 0, "steadfast": 0, "gallant": 0, "cumber": 0, "salutary": 0, "pertinent": 0, "adept": 0, "hermetic": 1 }, "wars": [ ], "naps": { "22492": 1470900097, "30820": 1470381237, "7049": 1470724141, "8397": 1471588142, "10614": 1472106542, "13665": 1471138380, "16296": 1470464941, "20567": 1472106542, "36661": 1469860142, "36662": 1470378542, "36667": 1470205742, "36675": 1470378542, "36678": 1470637741 } } As you can see for this call the wars field = []. I think the problem is the serialization process where an object (Dictionary in this case) becomes a list. I have been able to make a work around for this problem, and its more an annoyance than something else. (plzz do not delete the Wars field, I actually use that one)
I will ask Pavel how to.. effectively... make an object that is null (assuming that is what you're asking for?)
aurel1 [1046304] Admin
Staff
28 Jul 2016, 19:04 TCT · #6
I think we can use objects by default here. Can you check it now please?
{ "ID": 36677, "name": "JRT", "leader": 1621492, "co-leader": 660043, "best_chain": 29, "respect": 1005, "rank": 1816, "wars": [ ], "peace": [ ], "members": { "660043": { "name": "Sinja", "days_in_faction": 4 }, "1621492": { "name": "StonedAndy75", "days_in_faction": 32 } }, "specials": { "chaining": 0, "vigor": 0, "enormity": 0, "steadfast": 0, "gallant": 0, "cumber": 0, "salutary": 0, "pertinent": 0, "adept": 0, "hermetic": 1 }, "naps": { "22492": 1470900097, "30820": 1470381237, "7049": 1470724141, "8397": 1471588142, "10614": 1472106542, "13665": 1471138380, "16296": 1470464941, "20567": 1472106542, "36661": 1469860142, "36662": 1470378542, "36667": 1470205742, "36675": 1470378542, "36678": 1470637741 } } Looks the same as before....
aurel1 [1046304] Admin
Staff
29 Jul 2016, 10:07 TCT · #8
What request you are making (please provide url without key)?
Can you please provide the URL, without your API key, of the request you're making that gets you this issue?
Passing back to aurel1
aurel1 [1046304] Admin
Staff
4 Aug 2016, 06:56 TCT · #12
I need a feedback from thread starter - I don't see any problems in that request atm, empty arrays are objects now?
I am on hollyday right now, cannot test this atm.
aurel1 [1046304] Admin
Staff
4 Aug 2016, 08:44 TCT · #14
Please respond when you will have a time, I will keep this report open.
I'm going to close this for now, but please post back when you have the url for aurel1 and I'll reconfirm the report.