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
readerUtf8JsonReaderThe reader.
typeToConvertTypeThe type to convert.
optionsJsonSerializerOptionsAn 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
writerUtf8JsonWriterThe writer to write to.
valueSTypeThe value to convert to JSON.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.