Retrieve JSON file from JS trough php

I’m not convinced this is the cleanest way to do it but at least it work until I find something more efficient:

function json_gmap(){

  $get_file  = file_get_contents(get_template_directory_uri() . '/data/my.json');
  $json_to_array = json_decode($get_file,true);
      die (json_encode($json_to_array));

}
add_action('wp_ajax_json_gmap', 'json_gmap');
add_action('wp_ajax_nopriv_json_gmap', 'json_gmap');

Basically I decode my Json file to an array and the re-encode it to have it available in admin-ajax.php.

Any improvement is welcome 😀

Thanks

Matth