﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
2041	Improve JSON layout	markberger	daira	"I've been playing around with the web api and navigating the JSON is unnecessarily complicated. For example, this is what I get when I request info on one dirnode:

{{{
[
 ""dirnode"",
 {
  ""rw_uri"": ""URI:DIR2:5bbr..."",
  ""verify_uri"": ""URI:DIR2-Verifier:or4r..."",
  ""ro_uri"": ""URI:DIR2-RO:4z4rlm..."",
  ""children"": {
   ""file-1"": [
    ""filenode"",
    {
     ""format"": ""CHK"",
     ""verify_uri"": ""URI:CHK-Verifier:6vwhe..."",
     ""ro_uri"": ""URI:CHK:ncwvkn..."",
     ""mutable"": false,
     ""size"": 73,
     ""metadata"": {
      ""tahoe"": {
       ""linkmotime"": 1374966798.767442,
       ""linkcrtime"": 1374966798.767442
      }
     }
    }
   ],
   ""file-2"": [
    ""filenode"",
    {
     ""format"": ""CHK"",
     ""verify_uri"": ""URI:CHK-Verifier:vqtq4..."",
     ""ro_uri"": ""URI:CHK:3rbo..."",
     ""mutable"": false,
     ""size"": 396,
     ""metadata"": {
      ""tahoe"": {
       ""linkmotime"": 1374966841.575218,
       ""linkcrtime"": 1374966841.575218
      }
     }
    }
   ]
  },
  ""mutable"": true
 }
]
}}}

It doesn't make sense to return a list when I'm requesting info on one directory. The ""dirnode"" element does not need to preface the map and could instead be the info associated with a {{{ type }}} key. This isn't a huge inconvenience, but it makes the children unnecessarily complicated as well. Children should be a map that returns another map.

Also I don't think creating another dictionary for metadata adds any clarity or convenience.

These issues aren't a big deal when you're working with the api in Python or another dynamically typed language, but for statically typed languages this format is painful to parse."	defect	closed	minor	undecided	code-frontend-web	1.10.0	wontfix	http		
