repair_json 0.1.0

Repair incomplete JSON (e.g. from streaming APIs) so it can be parsed as it is received.
Documentation
  • Coverage
  • 90.91%
    10 out of 11 items documented2 out of 5 items with examples
  • Size
  • Source code size: 56.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.9 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • m1guelpf/repair-json
    36 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • m1guelpf

repair-json

Repair incomplete JSON (e.g. from streaming APIs or AI models) so it can be parsed as it's received.

crates.io download count badge docs.rs

Usage

let json_stream = json_source::stream().await?;

while let Some(incomplete_json) = json_stream.next().await {
    let valid_json = repair_json::repair(incomplete_json);

    // serde_json::from_str(valid_json).unwrap();
}

Refer to the documentation on docs.rs for detailed usage instructions.

License

This project is licensed under the MIT License - see the LICENSE file for details.