JSON Config Loader
Loads JSON configuration with validation-friendly typed access.
- Path
docs/examples/data/json_config.gb- Category
- Data Processing
Use this pattern when a script needs defaults but should still accept structured configuration from a file or environment-specific source.
Source
import io;
import json;
let raw = "{\"service\":\"billing\",\"port\":8080,\"debug\":false}";
let config = json.parse(raw);
string service = config["service"];
int port = config["port"];
bool debug = config["debug"];
io.println(service + " listening on " + (port as string));
io.println("debug: " + (debug as string));