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

       

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to