public Diagnostic ValidatePropertyDefinition(IDictionary <string, object> definition) { if (RootValidator == null) { throw new Exception("Could not find valid validator for schema validation."); } return(new Diagnostic() { IsValid = RootValidator.IsValid(definition), Error = RootValidator.Status.Error }); }
public Diagnostic ValidatePropertyDefinition(string json) { object obj; if (!Properties.Serialization.Json.TryDeserializeObject(json, out obj)) { throw new Exception("Invalid JSON data."); } if (RootValidator == null) { throw new Exception("Could not find valid validator for schema validation."); } return(new Diagnostic() { IsValid = RootValidator.IsValid(obj as IDictionary <string, object>), Error = RootValidator.Status.Error }); }