Cargo Features

Sonic-rs has no features set by default.

[dependencies]
sonic-rs = { version = "0.4.0-rc3", features = ["arbitrary_precision", "sort_keys", "use_raw", "utf8_lossy"] }
arbitrary_precision

Use an arbitrary precision number type representation when parsing JSON into sonic_rs::Value. This allows the JSON numbers will be serialized without loss of precision.

sort_keys

Sort the keys when serializing sonic_rs::Value.

use_raw

Will record the raw message of number and string when parse JSON into sonic::Value, and serialize the value will use the raw message

utf8_lossy

Allow to parse JSON with invalid UTF-8 and UTF-16 characters. Will replace them with \uFFFD (displayed as �).