SecretSafeAttributeValueJsonConverter
Namespace: Meshmakers.Octo.Communication.Contracts.Serialization
System.Text.Json property converter for untyped attribute values (object?, e.g.
RtEntityAttributeDto.Value) that guarantees an is never
written with its content, also when the serializer options do not carry
RtSecretValueJsonConverter and also when the secret is nested in a list or
record (AB#5528). Everything else is written exactly like the default object
handling (by runtime type) and read like the default (a JsonElement, or a
JsonNode when the options say so).
public sealed class SecretSafeAttributeValueJsonConverter : JsonConverter<Object>
Inheritance Object → JsonConverter → JsonConverter<Object> → SecretSafeAttributeValueJsonConverter
Remarks:
Apply it with [JsonConverter(typeof(SecretSafeAttributeValueJsonConverter))] on
object properties only; do not add it to .
Properties
HandleNull
public bool HandleNull { get; }
Property Value
Type
public Type Type { get; }
Property Value
Constructors
SecretSafeAttributeValueJsonConverter()
public SecretSafeAttributeValueJsonConverter()
Methods
Read(out Utf8JsonReader, Type, JsonSerializerOptions)
public object Read(out Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions
Returns
Write(Utf8JsonWriter, Object, JsonSerializerOptions)
public void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
Parameters
writer Utf8JsonWriter
value Object
options JsonSerializerOptions