ChildSchemaValidationError
A subschema validation error.
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
namespace NJsonSchema.Validation
{
public class ChildSchemaValidationError : ValidationError
{
public IReadOnlyDictionary<JsonSchema, ICollection<ValidationError>> Errors { get; set; }
public ChildSchemaValidationError(ValidationErrorKind kind, string property, 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 = string.Format("{0}: {1}\n", new object[2] {
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", new object[1] {
item.ToString().Replace("\n", "\n ")
});
}
text += "}\n";
}
return text;
}
}
}