Table of Contents

Class STypeJsonConverter

Namespace
DatabentoDotNet.Historical.Json
Assembly
DatabentoDotNet.Historical.dll

Reads and writes SType as the codec's wire string.

public sealed class STypeJsonConverter : JsonConverter<SType>
Inheritance
STypeJsonConverter
Inherited Members

Remarks

The symbology types travel on every request this library sends, but until batch.* no response carried one: symbology.resolve echoes both and this library reads neither, taking them from the request instead (see StypeIn for why). A batch job is the first response whose symbology types are the only record of what was asked for, months after the request object is gone.

Parse-only aliases are TryParseSType(string?, out SType)'s business, not this converter's; an unrecognised value throws for the reason SchemaJsonConverter gives.

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type SType.

public override SType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

SType

The converted value.

Write(Utf8JsonWriter, SType, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, SType value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

value SType

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.