[Geoserver-devel] [jira] Created: (GEOS-3632) REST JSON structures describing collections should be leaner (not nested with type-property)

REST JSON structures describing collections should be leaner (not nested with type-property)
--------------------------------------------------------------------------------------------

                 Key: GEOS-3632
                 URL: http://jira.codehaus.org/browse/GEOS-3632
             Project: GeoServer
          Issue Type: Improvement
          Components: REST
    Affects Versions: 2.0.0
            Reporter: Björn Harrtell
            Assignee: Andrea Aime

Currently collection types when represented in JSON are nested with a property describing element type.

Example:

{ "workspaces":{ "workspace":[ ..

Since JSON is geared towards beeing used with loosely typed languages the extra information seem unnecessary to me. In javascript in particular I think most developers would be surprised that a property "workspaces" isn't an array.

I would suggest skipping the inner property so that the above example becomes:

{ "workspaces": [ ...

I think it's even more silly with string collections, for example { "keywords": { "string": [ ..

I might be biased in this opinion though because I'm using this JSON as a datasource in Ext Js where you'd really want the leaner structure. Though I do think that the leaner structure is preferable in general if you use a loosely typed language.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira