A Rust JSON5 serializer and deserializer library built on the Serde framework.
json5-rs is a Rust library that provides serialization and deserialization capabilities for the JSON5 format, a superset of JSON designed to be more human-friendly. It solves the problem of working with configuration files that require features like comments, trailing commas, and unquoted keys, which are not supported in standard JSON. By leveraging the Serde framework, it allows Rust developers to easily parse and generate JSON5 data.
Rust developers who need to read or write configuration files in JSON5 format, particularly those working on projects where human readability and maintainability of config files are important.
Developers choose json5-rs for its strict adherence to the JSON5 specification, seamless integration with Serde, and focus on reliability for configuration file use cases. It offers a balance of performance and simplicity, making it a dependable choice over other JSON5 parsers in the Rust ecosystem.
A Rust JSON5 serializer and deserializer which speaks Serde.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Full compatibility with the Serde framework allows easy serialization and deserialization of Rust types, as demonstrated in the README examples for Config structs.
Adheres strictly to the official JSON5 spec, ensuring reliable parsing of extended syntax like comments, unquoted keys, and trailing commas without deviations.
Offers customization such as omitting quotes from object keys and formatting with indentation, making output more human-readable for configuration files.
Encodes byte arrays as hex strings, compatible with Serde's data model, which is useful for handling binary data in JSON5 formats.
Benchmarks in the README show it's about half as fast as serde-rs/json, as the project prioritizes a simpler codebase over optimization for high-throughput use cases.
Explicitly rejects supporting any extensions or relaxations of the JSON5 spec, limiting flexibility for projects needing custom or non-standard features.
Designed primarily for configuration files and not optimized for machine-to-machine communication, which may make it less suitable for network-heavy applications.