#streaming-json #repair #incomplete

repair_json

Repair incomplete JSON (e.g. from streaming APIs) so it can be parsed as it is received.

1 unstable release

0.1.0 Jan 17, 2024

#4 in #incomplete

Download history 62/week @ 2024-12-14 6/week @ 2024-12-21 6/week @ 2025-01-04 17/week @ 2025-01-11 28/week @ 2025-01-18 18/week @ 2025-01-25 36/week @ 2025-02-01 46/week @ 2025-02-08 43/week @ 2025-02-15 35/week @ 2025-02-22 30/week @ 2025-03-01 53/week @ 2025-03-08 98/week @ 2025-03-15 93/week @ 2025-03-22 493/week @ 2025-03-29

739 downloads per month
Used in 2 crates

MIT license

54KB
730 lines

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.

Dependencies

~195–630KB
~15K SLoC