[Geoserver-devel] [JIRA] (GEOS-7138) Problem parsing JSON for SQL layers

Federico Guizzardi created an issue

GeoServer / BugGEOS-7138

Problem parsing JSON for SQL layers

Issue Type:

BugBug

Affects Versions:

2.7.2, 2.6.4

Assignee:

Unassigned

Components:

REST

Created:

04/Aug/15 2:27 PM

Environment:

  • Linux Debian
  • Tomcat 7

Priority:

MediumMedium

Reporter:

Federico Guizzardi

Hi all,
I’m tring to override a sql layer on geoserver using rest interface (json).

My workflow is:

  1. get the original json from geoserver
  2. clone json using org.json java libs
  3. override original metadata entry with the follow

[…]
“metadata”: {
“entry”: {
@key”: “JDBC_VIRTUAL_TABLE”,
“virtualTable”: {
“sql”: “select * from mytablelayer”,
“name”: “mytablelayer”,
“escapeSql”: false,
“geometry”:

{ “srid”: 32633, “name”: “shape”, “type”: “Geometry” }

}
}
},
[…]
push it on geoserver using rest api.
What I get is this error on geoserver:

com.thoughtworks.xstream.converters.ConversionException: Expected element name but found sql instead : Expected element name but found sql instead
As defined on json.org:

An object is an unordered set of name/value pairs. An object begins with

{ (left brace) and ends with }

(right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma).
so why geoserver checks about keys order?

I tested it on geoserver 2.6.4 and 2.7.2 with same result.

Thanks for support.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v6.5-OD-08-001#65007-sha1:1fc9846)

Atlassian logo