-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
SwaggerGenOptions.cs
36 lines (25 loc) · 1.5 KB
/
SwaggerGenOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
namespace Swashbuckle.AspNetCore.SwaggerGen
{
public class SwaggerGenOptions
{
public SwaggerGeneratorOptions SwaggerGeneratorOptions { get; set; } = new SwaggerGeneratorOptions();
public SchemaGeneratorOptions SchemaGeneratorOptions { get; set; } = new SchemaGeneratorOptions();
// NOTE: Filter instances can be added directly to the options exposed above OR they can be specified in
// the following lists. In the latter case, they will be instantiated and added when options are injected
// into their target services. This "deferred instantiation" allows the filters to be created from the
// DI container, thus supporting contructor injection of services within filters.
public List<FilterDescriptor> ParameterFilterDescriptors { get; set; } = new List<FilterDescriptor>();
public List<FilterDescriptor> RequestBodyFilterDescriptors { get; set; } = new List<FilterDescriptor>();
public List<FilterDescriptor> OperationFilterDescriptors { get; set; } = new List<FilterDescriptor>();
public List<FilterDescriptor> DocumentFilterDescriptors { get; set; } = new List<FilterDescriptor>();
public List<FilterDescriptor> SchemaFilterDescriptors { get; set; } = new List<FilterDescriptor>();
}
public class FilterDescriptor
{
public Type Type { get; set; }
public object[] Arguments { get; set; }
public object FilterInstance { get; set; }
}
}