We're updating the issue view to help you get more done. 

json response is not consistent for get layers REST call

Description

In API, GET: /workspaces/{workspaceName}/layers
When number of layers are zero, it returns * "layers":" "* (i.e. empty string as value) .
When number of layers > zero, it returns json object (i.e. {...}) as value as shown in sample response below.

{
"layers": {
"layer": [
{
"name": "bugsites",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/workspaces\/sf\/layers\/bugsites.json"
},
]
}
}

Ideally it should return empty json object when no layers available.

Environment

Windows OS.

Status

Assignee

Unassigned

Reporter

Sanjay Dhonde

Triage

None

Fix versions

None

Affects versions

2.15.1

Priority

High