Class ValidationArgValueJsonConverter
- Namespace
- Trellis
- Assembly
- Trellis.Core.dll
Writes a ValidationArgValue as its underlying JSON primitive, and reads one back.
public sealed class ValidationArgValueJsonConverter : JsonConverter<ValidationArgValue>
- Inheritance
-
ValidationArgValueJsonConverter
- Inherited Members
- Extension Methods
Remarks
This is public because the System.Text.Json source generator requires an accessible converter type: a trimmed or AOT-published application whose JsonSerializerContext includes a violation payload cannot resolve an internal one, and fails to generate metadata for it at compile time.
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type ValidationArgValue.
public override ValidationArgValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
readerUtf8JsonReaderThe reader.
typeToConvertTypeThe type to convert.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.
Returns
- ValidationArgValue
The converted value.
Write(Utf8JsonWriter, ValidationArgValue, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, ValidationArgValue value, JsonSerializerOptions options)
Parameters
writerUtf8JsonWriterThe writer to write to.
valueValidationArgValueThe value to convert to JSON.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.