Example #1
0
        public override bool IsValid(JsonSchemaDefinitions definitions, JsonValue value, JsonSchemaCallback callback)
        {
            bool succeeded = true;

            foreach (JsonSchemaRule rule in rules)
                if (rule.IsValid(definitions, value, callback) == false)
                    succeeded = false;

            return succeeded;
        }
Example #2
0
        public JsonSchema Load()
        {
            JsonObject root = document.Root.As<JsonObject>();
            JsonSchemaRepository repository = new JsonSchemaRepository();

            JsonSchemaDefinitions definitions = new JsonSchemaDefinitions(repository, root);
            JsonSchema schema = new JsonSchema(parser.Parse(root), definitions);

            return schema;
        }
Example #3
0
 public JsonSchema(JsonSchemaRule rule, JsonSchemaDefinitions definitions)
 {
     this.rule = rule;
     this.definitions = definitions;
 }
Example #4
0
 public abstract bool IsValid(JsonSchemaDefinitions definitions, JsonValue value, JsonSchemaCallback callback);