Repository navigation
Add RFC 7464 JSON text sequences to JSONStreaming - #98
Merged
Merged
Conversation
JSONTextSequence reads application/json-seq texts framed by the record separator with the NDJSON pull model and budgets. Unterminated top-level scalars count as possibly truncated (RFC 7464 section 2.4). Malformed texts fail by default or are skipped and counted on request; resource failures are never skipped. JSONTextSequenceWriter writes RS, strict JSON and LF per value, as one sequence or in awaited bounded chunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
1.10 exact interchange: RFC 7464 JSON text sequences (
application/json-seq) in JSONStreaming.Reader:
JSONTextSequence0x1E) and runs to the next RS or EOF. It uses the same pull model, one-iterator ledger and per-text value quotas asNDJSONValueSequence.true,falseornullwithout trailing whitespace is reported as possibly truncated (.syntax/.unexpectedEOF). Bytes before the first RS are malformed.JSONTextSequenceOptions.MalformedTexts.skipskips them and continues at the next RS, as the RFC recommends;Iterator.skippedTextscounts them. Resource failures, cancellation and source errors are never skipped.record, and line and column within the text.Writer:
JSONTextSequenceWriterencode(_:)/encodeWithReport(_:)produce a whole sequence under one ledger.write(_:to:)/writeWithReport(_:to:)emit one text in awaited, bounded chunks, likeJSONAsyncWriter.Docs
TextSequences.md, with landing-page topics.Qualification (local)
Toolchain: Apple Swift 6.4.2 (swiftlang-6.4.2.1.9), macOS 27.3. Base:
97bfd7d.python3 Scripts/ci.py --lane nativeon9d2a26c: exit 0, 62/62 commands passed, 0 failed.python3 Scripts/ci.py --lane docson9d2a26c: exit 1. DocC rejected a cross-module symbol link toJSONWritingOptions.feee9c3changes that link to plain code and regenerates the CLI identity; nothing else changes.New tests (6) cover:
No tag, release or publication follows from this PR.
🤖 Generated with Claude Code