RestAPI styles endpoint Bug?

Hello all,

I’m working on useing the RestAPI to fill our Instances with content, e.g. create new featureTypes or chage a Style.
Due to that I have found that the Styles endpoint sometimes returns a 200 statuscode but dose not apply all changes to the sld-file on the server.
For Example this sld is on the server

<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>A_Test</sld:Name>
    <sld:UserStyle>
      <sld:Name>Default Styler</sld:Name>
      <sld:Title>dark yellow square point style</sld:Title>
      <sld:FeatureTypeStyle>
        <sld:Name>name</sld:Name>
        <sld:Rule>
          <sld:Title>dark yellow point</sld:Title>
          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:Mark>
                <sld:Fill>
                  <sld:CssParameter name="fill">#000000</sld:CssParameter>
                </sld:Fill>
              </sld:Mark>
              <sld:Size>6</sld:Size>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
</sld:StyledLayerDescriptor>

Changing the <sld:Name> under <sld:NamedLayer> local and then send it as body of a Put Request dose not update the line <sld:Name> on the Server. The staus code of the Response is 200. Chaning the the value of the color works. Using the webui I can change the line <sld:Name>, therefore I asume this is behaviore is not intendet.

On a similar node the Styles enpoint only works when the accept Header is “plain/text” or not pressent. Is this intendet? Cause as far as I see it every other endpoint can return “application/json” and “application/xml”.

The raw=true query parameter can be added to POST/PUT requests to save the exact style that was submitted. The default behavior involves parsing and re-encoding the style which may not always be what you want. When using the raw parameter with a PUT request, the style will be saved even if it is not parseable.