RtSecretValueNewtonsoftJsonConverter
Namespace: Meshmakers.Octo.Communication.Contracts.Serialization
Newtonsoft.Json converter for with exactly the behaviour of
RtSecretValueJsonConverter: writes the marker {"isSet":true|false}, never an
envelope or plaintext; reads a string as and the marker
(isSet plus the optional read-state fields keyMissing / setAt) as
Pending("") ("unchanged"); null stays null; anything else throws a
without the value.
public sealed class RtSecretValueNewtonsoftJsonConverter : JsonConverter<RtSecretValue>
Inheritance Object → JsonConverter → JsonConverter<RtSecretValue> → RtSecretValueNewtonsoftJsonConverter
Remarks:
Thin public wrapper: reading and writing delegate to the engine's strict wire contract (). Note that Newtonsoft prefers the type-level converter of over the converters of the serializer settings, so in practice the engine converter reads and writes; this converter only takes effect where it is applied to a member.
Properties
CanRead
public bool CanRead { get; }
Property Value
CanWrite
public bool CanWrite { get; }
Property Value
Constructors
RtSecretValueNewtonsoftJsonConverter()
public RtSecretValueNewtonsoftJsonConverter()
Methods
WriteJson(JsonWriter, RtSecretValue, JsonSerializer)
public void WriteJson(JsonWriter writer, RtSecretValue value, JsonSerializer serializer)
Parameters
writer JsonWriter
value RtSecretValue
serializer JsonSerializer
ReadJson(JsonReader, Type, RtSecretValue, Boolean, JsonSerializer)
public RtSecretValue ReadJson(JsonReader reader, Type objectType, RtSecretValue existingValue, bool hasExistingValue, JsonSerializer serializer)
Parameters
reader JsonReader
objectType Type
existingValue RtSecretValue
hasExistingValue Boolean
serializer JsonSerializer
Returns
RtSecretValue
WriteMarker(JsonWriter)
Writes the marker {"isSet":true}.
public static void WriteMarker(JsonWriter writer)
Parameters
writer JsonWriter
The writer
WriteMarker(JsonWriter, RtSecretValue)
Writes the marker {"isSet":true|false} of value
().
public static void WriteMarker(JsonWriter writer, RtSecretValue value)
Parameters
writer JsonWriter
The writer
value RtSecretValue
The secret value