Click or drag to resize
Json.NET Schema

Load JSON Schema from a file

 

This sample loads a JSchema from a file.

Sample
Usage
// 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);
}