[Geoserver-devel] [JIRA] (GEOS-10771) Problem with POST /rest/layers/{layer}/styles endpoint

Robin Chahal created an issue

GeoServer / BugGEOS-10771

Problem with POST /rest/layers/{layer}/styles endpoint

Issue Type:

BugBug

Affects Versions:

2.19.0

Assignee:

Unassigned

Components:

REST

Created:

06/Dec/22 8:40 PM

Priority:

MediumMedium

Reporter:

Robin Chahal

If I look at the Swagger page for the POST /rest/layers/

{layer}

/styles endpoint it suggests a styleBody in the format:
<?xml version=“1.0” encoding=“UTF-8”?>
<StyleInfoPost>
<name>roads_style</name>
<filename>roads.sld</filename>
</StyleInfoPost>

If I send a styleBody in that format I get an HTTP 500 error:
StyleInfoPost
com.thoughtworks.xstream.mapper.CannotResolveClassException: StyleInfoPost

The endpoint works if I send a styleBody in application/json format similar to:
{ style:

{ name: “styleName” }

}

Note: The same issue came up in StackExchange here:
https://gis.stackexchange.com/questions/375360/unable-to-associate-style-with-layer

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#100211-sha1:7eca2fb)

Atlassian logo