Class LdJsonConverters.ContextConverter
The JSON converter for Context.
Inherited Members
Namespace: LaunchDarkly.Sdk.Json
Assembly: LaunchDarkly.CommonSdk.dll
Syntax
public sealed class LdJsonConverters.ContextConverter : JsonConverter<Context>
Remarks
Applications should not need to use this class directly. It is used automatically in
System.Text.Json
conversion, or if you call SerializeObject<T>(T)
or DeserializeObject<T>(string)
LaunchDarkly's JSON schema for contexts is standardized across SDKs. There are two serialization formats, depending on whether it is a single-kind context or a multi-kind context. There is also a third format corresponding to how users were represented in JSON in older LaunchDarkly SDKs; this format is recognized automatically and supported for deserialization, but is not supported for serialization.
Constructors
ContextConverter()
Declaration
public ContextConverter()
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Declaration
public override Context Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonReader | reader | |
Type | typeToConvert | |
JsonSerializerOptions | options |
Returns
Type | Description |
---|---|
Context |
Overrides
Write(Utf8JsonWriter, Context, JsonSerializerOptions)
Declaration
public override void Write(Utf8JsonWriter writer, Context c, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | |
Context | c | |
JsonSerializerOptions | options |