Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: c7f939742a1f552262769dc4c3a5b56157fbe450
https://github.com/Checkmk/checkmk/commit/c7f939742a1f552262769dc4c3a5b5615…
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