baml.json.json

An untyped JSON value.

Reference version

Signature

type baml.json.json = null | bool | int | bigint | float | string | baml.json.json[] | map<string, baml.json.json>

An untyped JSON value.

JSON's one number type splits into three arms here. parse reads an integral number as int when it fits BAML's 63-bit int, as bigint otherwise, and reads a number with a fraction or exponent as float. Decoding into a declared int (to<int>, from_string<int>) is strict and rejects values outside the int range instead.

Reach an arm with match, or hand the value to to<T>.

Source:<builtin>/baml/ns_json/json.bamlbytes 451–536