Skip to content
Rico Suter edited this page Mar 15, 2018 · 8 revisions

With a schema processor, you can modify each generated schema after it has been generated.

Apply a processor to all schemas

Just implement the ISchemaProcessor and add an instance of the processor to the SchemaProcessors list of the JsonSchemaGeneratorSettings.

public class MySchemaProcessor : ISchemaProcessor
{
    public Task ProcessAsync(SchemaProcessorContext context)
    {
        ...
    }
}

Apply a processor to a specific type

[JsonSchemaProcessor(typeof(MySchemaProcessor))]
public class MyType
{
    ...
}
Clone this wiki locally