-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Text.Jsonbacklog-cleanup-candidateAn inactive issue that has been marked for automated closure.An inactive issue that has been marked for automated closure.needs-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationIssue has been initially triaged, but needs deeper consideration or reconsideration
Milestone
Description
Today if the JSON passed into the JsonSerializer needs to be the fully formed, this means its basically impossible to let the caller handle buffering (which is unfortunate). This seems solvable if we add a TryReadValue which would return false if the Serializer failed to Read the full object from the Utf8JsonReader.
public static class JsonSerializer
{
public static bool TryReadValue(ref Utf8JsonReader reader, Type returnType, out object value, JsonSerializerOptions options = null);
public static bool TryReadValue<TValue>(ref Utf8JsonReader reader, out TValue value, JsonSerializerOptions options = null);
}
This currently wouldn't preserve the serializer state, but it would let the caller buffer an entire JSON payload from a Stream of bytes without a surrounding envelope.
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Text.Jsonbacklog-cleanup-candidateAn inactive issue that has been marked for automated closure.An inactive issue that has been marked for automated closure.needs-further-triageIssue has been initially triaged, but needs deeper consideration or reconsiderationIssue has been initially triaged, but needs deeper consideration or reconsideration