I'm using NJsonSchema to generate JasonSchema from c# classes. I can create this schema:
{
"title": "SchemaModel",
"type": "object",
"additionalProperties": false,
"properties": {
"caseId": {
"title": "Case Id",
"type": [
"null",
"string"
],
"description": "desc.",
}
}
}
by using:
var settings = new JsonSchemaGeneratorSettings
{
DefaultPropertyNameHandling = PropertyNameHandling.CamelCase
};
var generator = new JsonSchemaGenerator(settings);
var schema = generator.Generate(typeof(SchemaModel));
but the I need to wrap this in an object called schema:
{
"schema": {
"title": "SchemaModel",
"type": "object",
"additionalProperties": false,
"properties": {
"caseId": {
"title": "Case Id",
"type": [
"null",
"string"
],
"description": "desc.",
}
}
}
}
How can I do this by NJsonSchema c# schema generator?