If you piece several of the existing answers together, you get a workable answer for this question.
NOTE: Using Godot 3.2
Actual function that loads JSON file:
func load_json_file(path):
"""Loads a JSON file from the given res path and return the loaded JSON object."""
var file = File.new()
file.open(path, file.READ)
var text = file.get_as_text()
var result_json = JSON.parse(text)
if result_json.error != OK:
print("[load_json_file] Error loading JSON file '" + str(path) + "'.")
print("\tError: ", result_json.error)
print("\tError Line: ", result_json.error_line)
print("\tError String: ", result_json.error_string)
return null
var obj = result_json.result
return obj
Calling that function from a scene script:
var loaded_object = load_json_file("res://game/json/abilities.json")