problem setting legend for existing style via rest

Description

I have an existing style and want to attach an external legend. So I do a PUT using a xml like:

<style>
<name>roads_style</name>
<languageVersion>
<version>1.0.0</version>
</languageVersion>
<filename>roads.sld</filename>
<legend>
<width>32</width>
<height>32</height>
<format>image/png; charset=UTF-8</format>
<onlineResource>legend.png</onlineResource>
</legend>
</style>

Doing this removes the style definition (sld, css) itself und creates a new empty style file.

Is this by design or a bug?

How would be the correct REST call to do this?

Regards

Tobias

Environment

geoserver 2.13.2

Assignee

Unassigned

Reporter

Tobias

Triage

None

Fix versions

None

Affects versions

None

Components

Priority

Medium
Configure