Class FieldViolationProblemDetail
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
CodestringThe machine-readable reason code.
DetailstringA human-readable explanation. Omitted when absent.
LocationViolationLocationWhere the offending value came from.
ArgsIReadOnlyDictionary<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
Code
The machine-readable reason code.
public string Code { get; init; }
Property Value
Detail
A human-readable explanation. Omitted when absent.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Detail { get; init; }
Property Value
Location
Where the offending value came from.
public ViolationLocation Location { get; init; }