Click or drag to resize
Json.NET Schema

Generate JSON Schema

 

This sample generates a new JSchema from a .NET type.

Sample
Types
public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }
}
Usage
JSchemaGenerator generator = new JSchemaGenerator();

JSchema schema = generator.Generate(typeof(Person));
// {
//   "type": "object",
//   "properties": {
//     "Name": {
//       "type": [ "string", "null" ]
//     },
//     "Age": { "type": "integer" }
//   },
//   "required": [ "Name", "Age" ]
// }