File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/Swashbuckle.AspNetCore.SwaggerGen/DependencyInjection Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,23 @@ public static void SchemaFilter<TFilter>(
343
343
} ) ;
344
344
}
345
345
346
+ /// <summary>
347
+ /// Extend the Swagger Generator with "filters" that can modify Schemas after they're initially generated
348
+ /// </summary>
349
+ /// <typeparam name="TFilter">A type that derives from IDocumentFilter</typeparam>
350
+ /// <param name="swaggerGenOptions"></param>
351
+ /// <param name="filterInstance">An instance of the filter, to enable reuse.</param>
352
+ public static void AddSchemaFilterInstance < TFilter > (
353
+ this SwaggerGenOptions swaggerGenOptions ,
354
+ TFilter filterInstance )
355
+ where TFilter : IDocumentFilter
356
+ {
357
+ swaggerGenOptions . DocumentFilterDescriptors . Add ( new FilterDescriptor
358
+ {
359
+ FilterInstance = filterInstance
360
+ } ) ;
361
+ }
362
+
346
363
/// <summary>
347
364
/// Extend the Swagger Generator with "filters" that can modify Parameters after they're initially generated
348
365
/// </summary>
@@ -361,6 +378,8 @@ public static void ParameterFilter<TFilter>(
361
378
} ) ;
362
379
}
363
380
381
+ xxxxxx
382
+
364
383
/// <summary>
365
384
/// Extend the Swagger Generator with "filters" that can modify RequestBodys after they're initially generated
366
385
/// </summary>
@@ -379,6 +398,8 @@ public static void RequestBodyFilter<TFilter>(
379
398
} ) ;
380
399
}
381
400
401
+ xxxxxx
402
+
382
403
/// <summary>
383
404
/// Extend the Swagger Generator with "filters" that can modify Operations after they're initially generated
384
405
/// </summary>
You can’t perform that action at this time.
0 commit comments