I have successfully developed a Joomla 4 API which receives JSON data containing HTML to update the database. - The HTML markup is stripped away when using this code:
$input = $this->input->json->get('data', null, 'json');
$data = json_decode(json_encode($input), false);
How can I make sure the HTML markup stays intact?