You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[API Proposal]: Add ReadOnlySequence<char> overload for WriteRawValue #102491
In #68223, two overloads for Utf8JsonWriter were proposed, one for ReadOnlySequence<byte> and one for ReadOnlySequence<char>. The latter was rejected due to the necessary surrogate pair state handling while writing the ReadOnlySpan<char> segments.
However, #67337 is currently underway to add the building blocks and state handling for that. Adding the rejected overload now seems like an easy addition.
API Proposal
namespace System.Text.Json
{
public sealed partial class Utf8JsonWriter
{
+ public void WriteRawValue(ReadOnlySequence<char> json, bool skipInputValidation = false);
}
}
API Usage
I could avoid building an entire in-memory, contiguous string just to have it written out as JSON. Other proposals like #97570 or #87362 would tie in very nicely as well.
Activity
dotnet-policy-service commentedon May 21, 2024
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.
Tragetaschen commentedon Jan 6, 2025
#67377 is implemented. Where can I send the cake for bribery?
teo-tsirpanis commentedon May 1, 2026
Duplicate of #68223; this API is available since .NET 8.
Tragetaschen commentedon May 2, 2026
This is wrong. The requested overload is the one specifically dropped during review. There is only a
byteoverload, not one forchar.#68223 (comment)