[Geoserver-devel] [jira] Created: (GEOS-4028) Inconsistent presentation of alternate styles in xml and json

Inconsistent presentation of alternate styles in xml and json
-------------------------------------------------------------

                 Key: GEOS-4028
                 URL: http://jira.codehaus.org/browse/GEOS-4028
             Project: GeoServer
          Issue Type: Bug
          Components: REST
            Reporter: Andrea Aime
            Assignee: Justin Deoliveira
             Fix For: 2.0.3

Just had a quick chat with Andreas over an odd issue about alternate styles, installed the rest config extension on demo.opengeo.org and indeed it seems the alternate styles in json have an odd structure.

Here is the output of http://demo.opengeo.org/geoserver/rest/layers/states.xml:

{code:xml}
<layer>
  <name>states</name>
  <path>/</path>
  <type>VECTOR</type>
  <defaultStyle>
    <name>population</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate" href="http://demo.opengeo.org/geoserver/rest/styles/population.xml&quot; type="application/xml"/>

  </defaultStyle>
  <styles>
    <style>
      <name>usflags</name>
      <atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate" href="http://demo.opengeo.org/geoserver/rest/styles/usflags.xml&quot; type="application/xml"/>
    </style>
    <style>
      <name>polygon</name>

      <atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate" href="http://demo.opengeo.org/geoserver/rest/styles/polygon.xml&quot; type="application/xml"/>
    </style>
  </styles>
  <resource class="featureType">
    <name>states</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate" href="http://demo.opengeo.org/geoserver/rest/workspaces/topp/datastores/states_shapefile/featuretypes/states.xml&quot; type="application/xml"/>
  </resource>
  <enabled>true</enabled>

  <attribution>
    <logoWidth>0</logoWidth>
    <logoHeight>0</logoHeight>
  </attribution>
</layer>
{code}

And here is the json version instead (pretty printed courtesy of http://jsonformatter.curiousconcept.com/):

{code:json}
{
   "layer":{
      "name":"states",
      "path":"/",
      "type":"VECTOR",
      "defaultStyle":{
         "name":"population",
         "href":"http://demo.opengeo.org/geoserver/rest/styles/population.json&quot;
      },
      "styles":{
         "style":[
            {
               "name":"usflags",
               "href":"http://demo.opengeo.org/geoserver/rest/styles/usflags.json&quot;
            },
            {
               "name":"polygon",
               "href":"http://demo.opengeo.org/geoserver/rest/styles/polygon.json&quot;
            }
         ]
      },
      "resource":{
         "@class":"featureType",
         "name":"states",
         "href":"http://demo.opengeo.org/geoserver/rest/workspaces/topp/datastores/states_shapefile/featuretypes/states.json&quot;
      },
      "enabled":true,
      "attribution":{
         "logoWidth":0,
         "logoHeight":0
      }
   }
}
{code}

See how it looks? Styles -> style -> array of styles ... hmmm....

--
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