public class RootConfig
{
/// <summary>
/// Configure s2s options
/// </summary>
public S2SOptions S2SAuth { get; set; }
}
and code for generation
public class Program
{
public static void Main(string[] args)
{
// var generator = new JsonSchemaGenerator(new SystemTextJsonSchemaGeneratorSettings());
// var schema = generator.Generate(typeof(S2SOptions));
// Console.WriteLine(schema.ToJson());
var settings = new SystemTextJsonSchemaGeneratorSettings()
{
};
var schema = new JsonSchema
{
AllowAdditionalProperties = true
};
var resolver = new JsonSchemaResolver(schema, settings); // used to add and retrieve schemas from the 'definitions'
var generator = new JsonSchemaGenerator(settings);
generator.Generate(schema, typeof(RootConfig), resolver); // generate root schema
Console.WriteLine(schema.ToJson());
File.WriteAllText("platformSchema.json", schema.ToJson());
}
}
It is generate json schema with additionalProperties:false on root, but i expected that it will be true
i have a sample model
and code for generation
It is generate json schema with additionalProperties:false on root, but i expected that it will be true
How set up true for additionalProperties on top level?