Crates.io | repair_json |
lib.rs | repair_json |
version | 0.1.0 |
source | src |
created_at | 2024-01-17 12:00:44.72236 |
updated_at | 2024-01-17 12:00:44.72236 |
description | Repair incomplete JSON (e.g. from streaming APIs) so it can be parsed as it is received. |
homepage | |
repository | https://github.com/m1guelpf/repair-json |
max_upload_size | |
id | 1102832 |
size | 55,814 |
Repair incomplete JSON (e.g. from streaming APIs or AI models) so it can be parsed as it's received.
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.
This project is licensed under the MIT License - see the LICENSE file for details.