REST API - Add an option to get all LayerGroups, with and without a workspace specified

Description

When using the following REST API

GET http://testserver.com/geoserver/rest/layergroups.json

I would expect every LayerGroup to be returned but only those layergroups without a workspace specified are returned. This means I'd have to iterate every workspace to get all layergroups which seems very painful

Environment

None

Activity

Show:
Andrea Aime
January 5, 2018, 5:29 PM
Edited

The same happens for rest/layers, it's how it's supposed to work, even if not ideal for some.
The current behavior cannot be changed for backwards compatibility, if you want you can sponsor an improvement (e.g, a query parameter to control what's in the output), see the process here:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Iain Hunter
January 8, 2018, 9:00 AM

Thanks for the quick feedback

In my testing the same does NOT happen with rest/layers. I get all the layers from every workspace, with a href link to get specific details on each layer. This was why I was surprised at the inconsistency.

Unfortunately I'm not much of a Java programmer or might have had a stab at fixing myself.

Andrea Aime
January 8, 2018, 9:09 AM
Edited

You're right, the layers case is different. Backwards compatibility however is a strong requirement. Switching type and working to feature request. One note, the REST API was fully rewritten about a year ago (it was based on a old unmaintained library), if you can check 2.10.x and it works in a different way (e..g, show this is a regression) then I can turn it back to "bug" status.

Assignee

Unassigned

Reporter

Iain Hunter

Triage

None

Fix versions

None

Affects versions

Components

Priority

High
Configure