Class JsonLDContextConverter
- Namespace
- ActivityPub.Types.Conversion.Converters
- Assembly
- ActivityPub.Types.dll
Custom JSON converter for the JSON-LD
@context
property.
public class JsonLDContextConverter : JsonConverter<JsonLDContext>
- Inheritance
-
JsonLDContextConverter
- Inherited Members
Remarks
We need THREE FUCKING CONVERTERS for a minimum-viable implementation!
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type JsonLDContext.
public override JsonLDContext? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
reader
Utf8JsonReaderThe reader.
typeToConvert
TypeThe type to convert.
options
JsonSerializerOptionsAn object that specifies serialization options to use.
Returns
- JsonLDContext
The converted value.
ReadContext(ref Utf8JsonReader, JsonSerializerOptions)
private static JsonLDContextObject ReadContext(ref Utf8JsonReader reader, JsonSerializerOptions options)
Parameters
reader
Utf8JsonReaderoptions
JsonSerializerOptions
Returns
ReadContextArray(ref Utf8JsonReader, JsonSerializerOptions)
private static JsonLDContext ReadContextArray(ref Utf8JsonReader reader, JsonSerializerOptions options)
Parameters
reader
Utf8JsonReaderoptions
JsonSerializerOptions
Returns
Write(Utf8JsonWriter, JsonLDContext, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, JsonLDContext value, JsonSerializerOptions options)
Parameters
writer
Utf8JsonWriterThe writer to write to.
value
JsonLDContextThe value to convert to JSON.
options
JsonSerializerOptionsAn object that specifies serialization options to use.