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

Description

If I look at the Swagger page for the POST /rest/layers/{layer}/styles endpoint, it suggests a styleBody in the format:

If I send a styleBody in that format I get an HTTP 500 error:

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

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

Environment

None

Activity

Andrea Aime
January 14, 2023 at 1:58 PM

The documentation shows an example of XML body with "<style>", StyleInfoPost is just the name of the parameter in the Swagger specification, it's not the root of the XML .

Cannot Reproduce

Details

Assignee

Reporter

Affects versions

Components

Priority

Created December 6, 2022 at 7:40 PM
Updated January 14, 2023 at 1:58 PM
Resolved January 14, 2023 at 1:58 PM