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}",
)
}| Version | Notes |
|---|---|
| 0.2.0 | Aligned with orjson 3.13.0 (yyjson 0.12.0 fork, vendor/ byte-identical to upstream); hardened bridge null/error handling; node tags are named constants; encode-error message state is thread-local (verified with ThreadSanitizer, see c/tsan_race_driver.c). |
| 0.1.1 | Initial release. |
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.