// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
namespace WireMock.Net.OpenApiParser.Models;
///
/// Error related to the Open API Document.
///
public class OpenApiError
{
///
/// Initializes the class.
///
public OpenApiError(string? pointer, string message)
{
Pointer = pointer;
Message = message;
}
///
/// Initializes a copy of an object
///
public OpenApiError(OpenApiError error)
{
Pointer = error.Pointer;
Message = error.Message;
}
///
/// Message explaining the error.
///
public string Message { get; set; }
///
/// Pointer to the location of the error.
///
public string? Pointer { get; set; }
///
/// Gets the string representation of .
///
public override string ToString()
{
return Message + (!string.IsNullOrEmpty(Pointer) ? " [" + Pointer + "]" : "");
}
}