示例#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;
        }
示例#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;
        }
示例#3
0
文件: JsonSchema.cs 项目: amacal/jinx
 public JsonSchema(JsonSchemaRule rule, JsonSchemaDefinitions definitions)
 {
     this.rule = rule;
     this.definitions = definitions;
 }
示例#4
0
 public abstract bool IsValid(JsonSchemaDefinitions definitions, JsonValue value, JsonSchemaCallback callback);