Skip to content

Commit

Permalink
sdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
Remco Lam committed Apr 26, 2024
1 parent 3846725 commit c43a0a1
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,23 @@ public static void SchemaFilter<TFilter>(
});
}

/// <summary>
/// Extend the Swagger Generator with "filters" that can modify Schemas after they're initially generated
/// </summary>
/// <typeparam name="TFilter">A type that derives from IDocumentFilter</typeparam>
/// <param name="swaggerGenOptions"></param>
/// <param name="filterInstance">An instance of the filter, to enable reuse.</param>
public static void AddSchemaFilterInstance<TFilter>(
this SwaggerGenOptions swaggerGenOptions,
TFilter filterInstance)
where TFilter : IDocumentFilter
{
swaggerGenOptions.DocumentFilterDescriptors.Add(new FilterDescriptor
{
FilterInstance = filterInstance
});
}

/// <summary>
/// Extend the Swagger Generator with "filters" that can modify Parameters after they're initially generated
/// </summary>
Expand All @@ -361,6 +378,8 @@ public static void ParameterFilter<TFilter>(
});
}

xxxxxx

/// <summary>
/// Extend the Swagger Generator with "filters" that can modify RequestBodys after they're initially generated
/// </summary>
Expand All @@ -379,6 +398,8 @@ public static void RequestBodyFilter<TFilter>(
});
}

xxxxxx

/// <summary>
/// Extend the Swagger Generator with "filters" that can modify Operations after they're initially generated
/// </summary>
Expand Down

0 comments on commit c43a0a1

Please sign in to comment.