| | 1 | | using Microsoft.Extensions.DependencyInjection; |
| | 2 | | using Plainquire.Filter.Swashbuckle.Filters; |
| | 3 | | using Swashbuckle.AspNetCore.SwaggerGen; |
| | 4 | | using System.Collections.Generic; |
| | 5 | | using System.Diagnostics.CodeAnalysis; |
| | 6 | |
|
| | 7 | | namespace Plainquire.Filter.Swashbuckle; |
| | 8 | |
|
| | 9 | | /// <summary> |
| | 10 | | /// Extensions to register entity filter extensions to Swashbuckle.AspNetCore (https://github.com/domaindrivendev/Swashb |
| | 11 | | /// </summary> |
| | 12 | | /// <autogeneratedoc /> |
| | 13 | | [SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] |
| | 14 | | public static class SwaggerGenOptionsExtensions |
| | 15 | | { |
| | 16 | | /// <summary> |
| | 17 | | /// Replaces action parameters of type <see cref="EntityFilter{TEntity}"/> with filterable properties of type <c>TEn |
| | 18 | | /// </summary> |
| | 19 | | /// <param name="options">The options.</param> |
| | 20 | | /// <param name="xmlDocumentationFilePaths">Paths to XML documentation files. Used to provide parameter descriptions |
| | 21 | | public static SwaggerGenOptions AddFilterSupport(this SwaggerGenOptions options, params string[] xmlDocumentationFil |
| | 22 | | { |
| 5 | 23 | | options.OperationFilter<EntityFilterParameterReplacer>(new List<string>(xmlDocumentationFilePaths)); |
| 5 | 24 | | options.OperationFilter<EntityFilterSetParameterReplacer>(new List<string>(xmlDocumentationFilePaths)); |
| 5 | 25 | | return options; |
| | 26 | | } |
| | 27 | | } |