baml.toml.item_from_json
Converts a JSON value to a TOML item.
Reference version
Signature
function baml.toml.item_from_json(json: baml.json.json) -> baml.toml.Item throws baml.json.DecodeError
Converts a JSON value to a TOML item.
Table.from_json is usually the better entry point, since it skips nulls
instead of erroring on them. This inverts item_to_json only up to the
datetime loss noted there: a JSON string stays a string, never a
baml.time value.
Throws
baml.json.DecodeErrorifjsonisnullorbigint, or if either appears as an array element anywhere beneath it. Nulls in object values are skipped by theTable.from_jsonthis recurses through.
Source:<builtin>/baml/ns_toml/toml.bamlbytes 5761–6231