<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />

Microsoft.IdentityModel.Tokens.Json.JsonSerializerPrimitives

public static JsonElement CreateJsonElement(IList<string> strings)

public static JsonElement CreateJsonElement(string json)

public static JsonException CreateJsonReaderException(ref Utf8JsonReader reader, string expectedType, string className, string propertyName, Exception innerException = null)

Creates a JsonException that provides information on what went wrong.

public static Exception CreateJsonReaderExceptionInvalidType(ref Utf8JsonReader reader, string expectedType, string className, string propertyName)

public static bool TryCreateTypeFromJsonElement<T>(JsonElement jsonElement, out T t)

public static void WriteAsJsonElement(ref Utf8JsonWriter writer, string json)

public static void WriteObject(ref Utf8JsonWriter writer, string key, object obj)

Writes an object as a JsonProperty. This was written to support what IdentityModel6x supported and is not meant to be a general object serializer. If a user needs to serialize a special value, then serialize the value into a JsonElement.

public static void WriteObjects(ref Utf8JsonWriter writer, IDictionary<string, object> dictionary)

public static void WriteObjectValue(ref Utf8JsonWriter writer, object obj)

Writes values into an array. Assumes the writer.StartArray() has been called.

public static void WriteStrings(ref Utf8JsonWriter writer, ReadOnlySpan<byte> propertyName, IList<string> strings)

public static void WriteStrings(ref Utf8JsonWriter writer, ReadOnlySpan<byte> propertyName, ICollection<string> strings)

public static void WriteStrings(ref Utf8JsonWriter writer, ReadOnlySpan<byte> propertyName, IList<string> strings, string extraString)