Repository navigation
Improve cross-chunk JSON serialization - #10092
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves how SourceResultDocument writes large scalar values (strings/numbers) that span multiple underlying data chunks by avoiding the “gather into a contiguous scratch buffer” path when JSON output is not indented.
Changes:
- Added
JsonWriter.WriteRawValueEnd(JsonTokenType)to finalize multi-chunk raw writes while updating the writer token state. - Updated
SourceResultDocumentto stream cross-chunk scalar bytes directly intoJsonWriterfor minimized output, while keeping the pooled scratch-buffer path for indented output. - Added tests covering cross-chunk scalar formatting and validating that oversized values fail before writing any output.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/HotChocolate/Json/src/Json/JsonWriter.cs | Adds a raw-write end overload that sets _tokenType for streamed scalar writes. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultDocument.cs | Streams cross-chunk scalar writes in minimized mode; adds max-token-size guard. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/ThrowHelper.cs | Adds a helper to throw a consistent ArgumentException for oversized JSON values. |
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Text/Json/SourceResultDocumentTests.cs | Adds tests for cross-chunk scalar output and oversized-value validation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Patch coverage100.0% of changed lines covered (66/66)
Project coverage: 53.4% (227699/426465 lines) |
This was referenced Jul 13, 2026
This was referenced Jul 20, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 1, 2026
This was referenced Sep 1, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 2026
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.
No description provided.