-
-
Notifications
You must be signed in to change notification settings - Fork 539
Schema Processors
Rico Suter edited this page Jan 18, 2020
·
8 revisions
- Package: NJsonSchema
- Type: NJsonSchema.Generation.ISchemaProcessor
With a schema processor, you can modify each generated schema after it has been generated.
Just implement the ISchemaProcessor
and add an instance of the processor to the SchemaProcessors
list of the JsonSchemaGeneratorSettings
.
public class MySchemaProcessor : ISchemaProcessor
{
public void Process(SchemaProcessorContext context)
{
...
}
}
settings.SchemaProcessors.Add(new MySchemaProcessor());
[JsonSchemaProcessor(typeof(MySchemaProcessor))]
public class MyType
{
...
}
TODO: Add sample from here: https://github.com/RSuter/NSwag/wiki/Document-Processors-and-Operation-Processors#sample-add-additional-types-from-an-assembly