[Geoserver-devel] [JIRA] (GEOS-9134) REST API - GET JSON for ImageMosaic coverage returns improper value inside parameters.entry array

Jason Greenlaw created an issue

GeoServer / BugGEOS-9134

REST API - GET JSON for ImageMosaic coverage returns improper value inside parameters.entry array

Issue Type:

BugBug

Affects Versions:

2.14.1

Assignee:

Unassigned

Attachments:

conus.zip, exception.txt, get-json-response.json, get-xml-response.xml

Components:

image mosaic, REST

Created:

26/Feb/19 9:38 PM

Environment:

Docker/Alpine Linux 3.8.2, OpenJDK 1.8.0_191, Tomcat 8.5.37

Priority:

LowLow

Reporter:

Jason Greenlaw

After creating a simple PostGIS-backed ImageMosaic from a directory of GeoTIFFs, performing a GET with Content-Type: application/json on the generated coverage resource, e.g.

http://localhost:8888/geoserver/rest/workspaces/testworkspace/coveragestores/imagemosaicname/coverages/imagemosaicname

returns a naked string (the nativeCoverageName value, e.g. “imagemosaicname”) at the end of the coverage.parameters.entry array, where an object/map is expected. get-json-response.json

By contrast, if XML is requested (using Content-Type: application/xml), this value is instead returned inside a <nativeCoverageName> element as a sibling of <parameters> (rather than a descendant). get-xml-response.xml

If the unaltered GET response JSON is pasted into a PUT request to update the resource, it results an HTTP 500 error and an exception exception.txt. If this value is removed from the end of the coverage.parameters.entry array before issuing the PUT request, the PUT succeeds.

Steps to reproduce exception look something like this:

  1. Extract conus.zip to desired data location (e.g. /path/to/conus)
  2. Update PostGIS database connection information in datastore.properties
  3. curl -XPOST -H “Content-type: application/json” -d ‘{“namespace”:{“prefix”:“obs”,“uri”:“http://obs”}}’ ‘http://localhost:8888/geoserver/rest/namespaces
  4. curl -XPUT -H ‘Content-Type: text/plain’ -d ‘file:///path/to/conus’ ‘http://localhost:8888/geoserver/rest/workspaces/obs/coveragestores/mrms_basereflect_conus/external.imagemosaic?configure=all&coverageName=mrms_basereflect_conus
  5. curl -XGET -H “Content-type: application/json” -H ‘Accept: application/json’ ‘http://localhost:8888/geoserver/rest/workspaces/obs/coveragestores/mrms_basereflect_conus/coverages/mrms_basereflect_conus’ > response.json
  6. curl -XPUT -H “Content-type: application/json” ‘http://localhost:8888/geoserver/rest/workspaces/obs/coveragestores/mrms_basereflect_conus/coverages/mrms_basereflect_conus’ --data-binary “@response.json

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100098-sha1:8896431)

Atlassian logo