MoonBit bindings for orjson's JSON engine (yyjson), with orjson-compatible parsing and serialization semantics.
///|
test {
let json = @orjson.parse("{\"a\": [1, 2.5, true, null]}")
let text = @orjson.stringify(json)
assert_eq(text, "{\"a\":[1,2.5,true,null]}")
// indented output with sorted keys (like OPT_INDENT_2 | OPT_SORT_KEYS)
let pretty = @orjson.stringify_with(json, indent=2, sort_keys=true)
assert_eq(
pretty, "{\n \"a\": [\n 1,\n 2.5,\n true,\n null\n ]\n}",
)
}pub(all) suberror JsonError {
DecodeError(String, Int)
EncodeError(String)
}Install
Download zipMoonBit bindings for orjson's JSON engine (yyjson), with orjson-compatible parsing and serialization semantics.