Class LdJsonConverters.UserConverter
The JSON converter for User.
Inherited Members
Namespace: LaunchDarkly.Sdk.Json
Assembly: LaunchDarkly.CommonSdk.dll
Syntax
public sealed class LdJsonConverters.UserConverter : JsonConverter<User>
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 users is standardized across SDKs. It corresponds to the User model, rather than the richer Context model; any JSON representation of a User can also be decoded as a Context, but not vice versa.
Constructors
UserConverter()
Declaration
public UserConverter()
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Read and convert the JSON to T.
Declaration
public override User Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | The Utf8JsonReader to read from. |
| Type | typeToConvert | The Type being converted. |
| JsonSerializerOptions | options | The JsonSerializerOptions being used. |
Returns
| Type | Description |
|---|---|
| User | The value that was converted. |
Overrides
Remarks
A converter may throw any Exception, but should throw
Write(Utf8JsonWriter, User, JsonSerializerOptions)
Write the value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, User u, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | The Utf8JsonWriter to write to. |
| User | u | |
| JsonSerializerOptions | options | The JsonSerializerOptions being used. |
Overrides
Remarks
A converter may throw any Exception, but should throw