Refit.SystemTextJsonContentSerializer
public sealed class SystemTextJsonContentSerializer : IHttpContentSerializer, IStreamingContentSerializer, ISynchronousContentSerializer, ISynchronousContentDeserializer
A class implementing IHttpContentSerializer using the System.Text.Json APIs.
Gets the JSON serialization options this serializer uses, exposed so a query converter can walk a
registered type's JsonTypeInfo without reflection.
A class implementing IHttpContentSerializer using the System.Text.Json APIs.
public SystemTextJsonContentSerializer()
Initializes a new instance of the SystemTextJsonContentSerializer class.
Creates new JsonSerializerOptions and fills it with default parameters.
Creates JsonSerializerOptions that are eligible for the System.Text.Json source-generated
fast-path on serialization. Unlike GetDefaultJsonSerializerOptions, these options add no
converters and leave number handling at its default. Custom converters and number handling that changes
writing can disable the fast-path; AllowReadingFromString alone does not. Assign a generated TypeInfoResolver (a
JsonSerializerContext generated in Serialization or
Default mode) to enable it. The fast-path runs through the synchronous
serialization primitives (SerializeToUtf8Bytes / Serialize(Utf8JsonWriter, ...)); the
async content path can also use it for repeated small payloads when the runtime's size checks permit it.
public IAsyncEnumerable<T> DeserializeStreamAsync<T>(Stream stream, StreamingContentFormat format, CancellationToken cancellationToken = default)
public Task<T> FromHttpContentAsync<T>(HttpContent content, CancellationToken cancellationToken = default)
Calculates what the field name should be for the given property. This may be affected by custom attributes the serializer understands.