Load JSON Schema from a file |
This sample loads a JSchema from a file.
// read file into a string and parse JSchema from the string JSchema schema1 = JSchema.Parse(File.ReadAllText(@"c:\schema.json")); // load JSchema directly from a file using (StreamReader file = File.OpenText(@"c:\schema.json")) using (JsonTextReader reader = new JsonTextReader(file)) { JSchema schema2 = JSchema.Load(reader); }