feat: add JSON Lines (JSONL/NDJSON) reader/writer#55
Merged
Conversation
Implements JSONL format support: - Parser: each non-empty line → JSON value, result is always an array - Writer: each array element → one compact JSON line, trailing newline - Empty lines and whitespace-only lines are skipped - Error messages include line numbers for invalid JSON - Mixed types per line supported (objects, arrays, primitives) - CLI integration: -f jsonl/-t jsonl, auto-detect from .jsonl/.ndjson - Comprehensive tests: parsing, serialization, round-trips, edge cases Fixes #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements JSON Lines (JSONL / NDJSON) format support.
Changes
from_str,from_reader): each non-empty line is parsed as a JSON value; the result is always an arrayto_string): each array element becomes one compact JSON line; non-array values become a single line-f jsonl/-t jsonl, auto-detect from.jsonland.ndjsonextensionsjson_to_valueandvalue_to_jsoninformats::jsonpub(crate)so JSONL can reuse themFixes #26