check_json(value: string) -> string

check_json validates that a string holds JSON. Well-formed documents return an empty string, while syntax or structural problems return a non-empty error message string. The argument must be string-typed in OPAL.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

make_col ok: check_json(string(payload))

Validates raw JSON text and maps a clean document to an empty string while surfacing errors as text via check_json.

make_col msg: check_json('{"k": 1, "k": 2}')

Shows check_json returning a non-empty diagnostic when duplicate object keys violate strict JSON rules.