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

Description

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.

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

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

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

Environment

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

Assignee

Unassigned

Reporter

Jason Greenlaw

Triage

Fix versions

None

Affects versions

Components

Priority

Low
Configure