request/src/request.validation/Problem.cs

35 lines
850 B
C#
Raw Normal View History

2026-05-16 09:49:04 +02:00
// 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>
2026-05-16 11:38:17 +02:00
public required PropertyPath PropertyPath { get; init; }
2026-05-16 09:49:04 +02:00
/// <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; }
}