Table of Contents

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

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An 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

writer Utf8JsonWriter

The writer to write to.

value ValidationArgValue

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.