Class RuleViolationProblemDetail
JSON shape used for rule violations in ProblemDetails extensions.
public sealed record RuleViolationProblemDetail : IEquatable<RuleViolationProblemDetail>
- Inheritance
-
RuleViolationProblemDetail
- Implements
- Inherited Members
- Extension Methods
Constructors
RuleViolationProblemDetail(string, string?, IReadOnlyList<ViolationLocation>, IReadOnlyDictionary<string, ValidationArgValue>?)
JSON shape used for rule violations in ProblemDetails extensions.
public RuleViolationProblemDetail(string Code, string? Detail, IReadOnlyList<ViolationLocation> Locations, IReadOnlyDictionary<string, ValidationArgValue>? Args)
Parameters
CodestringThe machine-readable reason code.
DetailstringA human-readable explanation. Omitted when absent.
LocationsIReadOnlyList<ViolationLocation>Every location the rule spans. Always present: an empty array is a positive statement that the rule is form-level rather than bound to any field, which an omitted member could not express.
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
Locations
Every location the rule spans. Always present: an empty array is a positive statement that the rule is form-level rather than bound to any field, which an omitted member could not express.
public IReadOnlyList<ViolationLocation> Locations { get; init; }