Generate with ContractResolver |
This sample generates a new JSchema with a IContractResolver.
public class Person { public string Name { get; set; } public int Age { get; set; } }
JSchemaGenerator generator = new JSchemaGenerator(); // change contract resolver so property names are camel case generator.ContractResolver = new CamelCasePropertyNamesContractResolver(); JSchema schema = generator.Generate(typeof(Person)); // { // "type": "object", // "properties": { // "name": { // "type": [ "string", "null" ] // }, // "age": { "type": "integer" } // }, // "required": [ "name", "age" ] // }