Branch: refs/heads/2.3.0
Home:
https://github.com/Checkmk/checkmk
Commit: e4e49ca2cf0771273d8b2618be0f8db99e256616
https://github.com/Checkmk/checkmk/commit/e4e49ca2cf0771273d8b2618be0f8db99…
Author: Leonardo Petrora <leonardo.petrora(a)checkmk.com>
Date: 2024-06-18 (Tue, 18 Jun 2024)
Changed paths:
M cmk/gui/openapi/restful_objects/decorators.py
M tests/unit/cmk/gui/openapi/test_endpoint.py
Log Message:
-----------
Allow content negotiation in the REST API
The `accept` parameter, originally defined as a string can now also
be a list of strings indicating that more than one type of content is
acceptable by the endpoint.
In addition, the function is informed of the type of content received to facilitate
processing.
Example:
```
@endpoint(
...
accept=['application/json', 'application/gzip'],
)
def my_endpoint (params: Mapping[str, Any]) -> Result:
body = params['body']
content_type = params['content_type']
...
```
CMK-17757
Change-Id: Ib59eba172c6d9babdefdaf8fa1932b46305eda50
To unsubscribe from these emails, change your notification settings at
https://github.com/Checkmk/checkmk/settings/notifications