[tahoe-lafs-trac-stream] [tahoe-lafs] #2041: Improve JSON layout

tahoe-lafs trac at tahoe-lafs.org
Fri Aug 2 03:20:54 UTC 2013


#2041: Improve JSON layout
-----------------------------------+--------------------
     Reporter:  markberger         |      Owner:  daira
         Type:  defect             |     Status:  closed
     Priority:  minor              |  Milestone:  2.0.0
    Component:  code-frontend-web  |    Version:  1.10.0
   Resolution:  wontfix            |   Keywords:  http
Launchpad Bug:                     |
-----------------------------------+--------------------
Changes (by daira):

 * status:  new => closed
 * resolution:   => wontfix
 * component:  unknown => code-frontend-web


Comment:

 Replying to [ticket:2041 markberger]:
 > I've been playing around with the web api and navigating the JSON is
 unnecessarily complicated. [...]
 >
 > It doesn't make sense to return a list when I'm requesting info on one
 directory.

 The outermost level of a JSON object must be a list or a dictionary. In
 this case we chose to use a list in which the first element gives the
 type.

 While you're right that this could have been done a little more simply (by
 using a dictionary {{{{"type": "dirnode", ...}}}} rather than a list
 {{{["dirnode, {...}]}}} for example), I don't think it is worth the hassle
 of an incompatible change, which would be very disruptive.

 > Also I don't think creating another dictionary for metadata adds any
 clarity or convenience.

 I disagree: what would you do about metadata keys that clash with standard
 fields like {{{"format"}}}? You could disallow a fixed set of strings, but
 then you'd be prevented from adding more standard fields. You could escape
 or prefix the metadata keys, but I don't really see that this is simpler
 than using a nested dictionary.

 Thanks for the suggestions, but I'm wontfixing this.

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2041#comment:1>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list