How to render response in json of a object listing

Code is follow :slight_smile:

$result = new DataObject\Comments\Listing();
$result->setCondition("o_parentId = ".$request->get(‘blogid’));
$result->load();

    echo "<pre>";

    print_r($result);
    

    die();

I need json response for $result.

return $this->json($list->getObjects()) sort of, not sure if it actually works though

Thank you for solution.