ChildSchemaValidationError
A subschema validation error.
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace NJsonSchema.Validation
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public class ChildSchemaValidationError : ValidationError
{
public IReadOnlyDictionary<JsonSchema, ICollection<ValidationError>> Errors { get; set; }
public ChildSchemaValidationError(ValidationErrorKind kind, [System.Runtime.CompilerServices.Nullable(2)] string property, [System.Runtime.CompilerServices.Nullable(2)] string path, IReadOnlyDictionary<JsonSchema, ICollection<ValidationError>> errors, JToken token, JsonSchema schema)
: base(kind, property, path, token, schema)
{
Errors = errors;
}
public override string ToString()
{
string text = $"{base.Kind}""{base.Path}""";
foreach (KeyValuePair<JsonSchema, ICollection<ValidationError>> error in Errors) {
text += "{\n";
foreach (ValidationError item in error.Value) {
text += string.Format(" {0}\n", item.ToString().Replace("\n", "\n "));
}
text += "}\n";
}
return text;
}
}
}