ListAccounts JSON array data isn't consistently formatted (compared to ListReceivedByAccount) When I perform a ListAccounts query I get this:

  {
  "result": {
    "": 0.0,
    "account": 0.0,
    "account3": 0.0,
    "account7": 0.0
  },
  "error": null,
  "id": "1"
}


However ListReceivedByAccount(0, true); looks like this:

  {
   "result": [
     {
       "account": "",
       "amount": 0.0,
       "confirmations": 0
     },
     {
       "account": "account",
       "amount": 0.0,
       "confirmations": 0
     },
     {
       "account": "account3",
       "amount": 0.0,
       "confirmations": 0
     },
     {
       "account": "account7",
       "amount": 0.0,
       "confirmations": 0
     }
   ],
   "error": null,
   "id": "1"


Notice how the embedded array data is formatted differently?  Is there a name or term that describes these different array formats (named vs unnamed)?

Why is it different and can this be fixed in a future version? 

If it is fixed in a future version will the outermost "id" property become "2" so I can add the logic to my parsers?
JSON data structure supports lists (arrays).


http://en.wikipedia.org/wiki/JSON


In the first API command (ListAccounts) the result contents is an object which contains a string.  Inside this string is a set of data records, each of which is a key/value item.  

In the second (ListReceivedByAccount) the result contents is an array of objects, each of which holds account data.

That does appear inconsistent, where perhaps the first call should have returned an array as well.

However a rule of thumb is that existing APIs should not change.  They can be deprecated and replaced but a call is expected to behave in a consistent manner.  

The Bitcoin client is an open source project and thus an issue ticket for this inconsistency can be opened and a pull request with the source for a new API call submitted.  Whether such an issue is merged into the client depends on a number of factors, including severity of problem.