REST API v2.2 host labels

It has been fun to find out the hard way, that reading & writing/updating host labels via the API has some issues.

How to get/post/put host labels is explained in this video starting around minute 10. Working with the Checkmk REST API
What this video forgets to mention, is when writing host properties this way, all host properties NOT fed via the json will be dropped! Seems like a massive flaw/bug.

via the swagger ui (http://yourmkserver/yoursite/check_mk/api/1.0/ui/#) you can test and reproduce easily

GET /objects/host/config/{host_name} will return a json and etag in the response headers.

if you now want to add 1 host label, using PUT /objects/host/config/{host_name} you need to feed the entire attributes block, minus the meta-data.
Nothing like this is explained in the aforementioned video.

If you don’t do that, you only lose all properties, like the host ip. and every other tag & label under attributes.