There are two options how to handle PUT on {baseResource}/styles/{styleId}, depending on whether the server supports automated derivation of stylesheets in other style encodings.
The PUT request removes all existing stylesheets of the style. The submitted stylesheet is accepted as the new style definition. If the server supports automatic derivation of stylesheets in other style encodings, it will derive other stylesheets from the new style definition and add them to the style metadata.
The PUT request sets or replaces the current stylesheet for the media type specified in the Content-Type header, but leaves other stylesheets of the style untouched. That is, all stylesheets are managed separately by clients.
Do we want to support one or both of the options? How do clients know the behaviour of the API?
This is only an issue for clients that manage styles and stylesheets, not for clients that simply fetch styles.
It is not an issue specific to styles, it can also affect other resources.
Conditional headers could help here to avoid unintentional overrides. Similar to the case with Features where two clients may update the same feature and the conditional headers can avoid this. @cportele will draft a description how this capability can be used for these cases, too.
There are two options how to handle PUT on
{baseResource}/styles/{styleId}
, depending on whether the server supports automated derivation of stylesheets in other style encodings.The PUT request removes all existing stylesheets of the style. The submitted stylesheet is accepted as the new style definition. If the server supports automatic derivation of stylesheets in other style encodings, it will derive other stylesheets from the new style definition and add them to the style metadata.
The PUT request sets or replaces the current stylesheet for the media type specified in the Content-Type header, but leaves other stylesheets of the style untouched. That is, all stylesheets are managed separately by clients.
Do we want to support one or both of the options? How do clients know the behaviour of the API?