I have written some custom endpoints in wordpress plugin. Previously when i used wp_send_json to return data from custom endpoint. But as of wordpress 5.5 the usage of wp_send_json is deprecated. Now Iam returning WP_REST_Response from the custom endpoint. But when i try the request after this logic change Iam getting blank responses.
Here is the code iam using to send response from callback.
public static function sendJSON($data)
{
$response = [];
$response = ["result" => $data['data'], "result_length" => sizeof($data['data']), "status_message" => "Success", "status" => $data['status']];
return new WP_REST_Response($response, 200);
}