feat: add request validation
This commit is contained in:
parent
1218d3617a
commit
de2d0e2693
32 changed files with 1829 additions and 1 deletions
35
src/request.validation/Problem.cs
Normal file
35
src/request.validation/Problem.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) The Geekeey Authors
|
||||
// SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
namespace Geekeey.Request.Validation;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a validation problem identified during a request validation process.
|
||||
/// </summary>
|
||||
public record Problem
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the property.
|
||||
/// </summary>
|
||||
public required string PropertyName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Custom severity level associated with the failure.
|
||||
/// </summary>
|
||||
public Severity Severity { get; init; } = Severity.Error;
|
||||
|
||||
/// <summary>
|
||||
/// The error message
|
||||
/// </summary>
|
||||
public required string Message { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the error code.
|
||||
/// </summary>
|
||||
public string? Code { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The property value that caused the failure.
|
||||
/// </summary>
|
||||
public object? AttemptedValue { get; init; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue