json

.json path:{String} -> Any

Loads a JSON file and returns its content as a dictionary if it's representing a JSON object, or as an iterable collection if it's representing a JSON array.

From a JSON array:

.json {people.json}::foreach
.1::get {name} is from .1::get {address}::get {country}

From a JSON object:

.json {config.json}::get {database}::get {host}

Temporary scoping of a JSON object via let:

.json {user.json}::let
.1::get {name} is .1::get {age} years old

Return

a dictionary or iterable representing the content of the JSON file located in path

Parameters

path

path of the JSON file (with extension) to load

Throws

if the file does not exist or is not a valid JSON file

Permissions

project-read
to read JSON files located in the project directory
global-read
to read JSON files located outside the project directory

Wiki page

data-from-json