Table of Contents

Class FieldViolationProblemDetail

Namespace
Trellis.Asp
Assembly
Trellis.Asp.dll

JSON shape used for field violations in ProblemDetails extensions.

public sealed record FieldViolationProblemDetail : IEquatable<FieldViolationProblemDetail>
Inheritance
FieldViolationProblemDetail
Implements
Inherited Members
Extension Methods

Constructors

FieldViolationProblemDetail(string, string?, ViolationLocation, IReadOnlyDictionary<string, ValidationArgValue>?)

JSON shape used for field violations in ProblemDetails extensions.

public FieldViolationProblemDetail(string Code, string? Detail, ViolationLocation Location, IReadOnlyDictionary<string, ValidationArgValue>? Args)

Parameters

Code string

The machine-readable reason code.

Detail string

A human-readable explanation. Omitted when absent.

Location ViolationLocation

Where the offending value came from.

Args IReadOnlyDictionary<string, ValidationArgValue>

Arguments that parameterize the message. Omitted when absent.

Properties

Args

Arguments that parameterize the message. Omitted when absent.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyDictionary<string, ValidationArgValue>? Args { get; init; }

Property Value

IReadOnlyDictionary<string, ValidationArgValue>

Code

The machine-readable reason code.

public string Code { get; init; }

Property Value

string

Detail

A human-readable explanation. Omitted when absent.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Detail { get; init; }

Property Value

string

Location

Where the offending value came from.

public ViolationLocation Location { get; init; }

Property Value

ViolationLocation