feat: add request validation

This commit is contained in:
Louis Seubert 2026-05-16 09:49:04 +02:00
commit de2d0e2693
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
32 changed files with 1829 additions and 1 deletions

View 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; }
}