Under what circumstances will Utf8JsonReader.HasValueSequence be true?

TheBuzzSaw 1 Reputation point
2020-11-27T22:27:08.71+00:00

I have begun working with raw value spans and sequences inside my JSON converters. I noticed that Utf8JsonReader provides a property to check to see whether the value is a sequence: HasValueSequence. When will this be set to true? I noticed that JsonDocument accepts a ReadOnlySequence<byte>, but I am mostly interested in the context of ASP.NET Core. I tried sending a 10MB JSON value to my endpoint, and it still was not a sequence.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,594 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,995 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.