{"id":13441759,"url":"https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions","last_synced_at":"2025-03-20T12:32:43.568Z","repository":{"id":34844066,"uuid":"184404541","full_name":"unchase/Unchase.Swashbuckle.AspNetCore.Extensions","owner":"unchase","description":":hammer: A library contains a bunch of extensions (filters) for Swashbuckle.AspNetCore.","archived":false,"fork":false,"pushed_at":"2024-12-17T22:26:28.000Z","size":466,"stargazers_count":118,"open_issues_count":5,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-17T14:03:59.591Z","etag":null,"topics":["openapi","swagger","swashbuckle"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unchase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-01T11:07:12.000Z","updated_at":"2025-02-16T03:22:33.000Z","dependencies_parsed_at":"2025-01-19T20:04:07.398Z","dependency_job_id":"c37672d0-1280-47fb-930d-efca82422350","html_url":"https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions","commit_stats":{"total_commits":83,"total_committers":5,"mean_commits":16.6,"dds":"0.20481927710843373","last_synced_commit":"e68b39fdf93db48292769d504fc5e44d44a52b2b"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.Swashbuckle.AspNetCore.Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.Swashbuckle.AspNetCore.Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.Swashbuckle.AspNetCore.Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.Swashbuckle.AspNetCore.Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unchase","download_url":"https://codeload.github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047628,"owners_count":20389206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openapi","swagger","swashbuckle"],"created_at":"2024-07-31T03:01:37.744Z","updated_at":"2025-03-20T12:32:43.562Z","avatar_url":"https://github.com/unchase.png","language":"C#","funding_links":["https://www.buymeacoffee.com/nikolaychebotov"],"categories":["HarmonyOS","C\\#"],"sub_categories":["Windows Manager"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions/\"\u003e\n    \u003cimg src=\"assets/logo.png\" alt=\"Unchase Swashbuckle Asp.Net Core Extensions Logo\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[Unchase Swashbuckle Asp.Net Core Extensions](https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions/) is a library contains a bunch of extensions (filters) for [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore).\n\n\u003e The project is developed and maintained by [Nikolay Chebotov (**Unchase**)](https://github.com/unchase).\n\n## Breaking Changes\n\n* Since [v2.0.0](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/releases/tag/v2.0.0) supports [Swashbuckle.AspNetCore 5.0.0](https://www.nuget.org/packages/Swashbuckle.AspNetCore/) with **breaking changes**.\n\nFor old versions see [README_OLD.md](README_OLD.md).\n\n* Since [v2.3.0](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/releases/tag/v2.3.0) there are [**breaking changes**](#breaking-changes-2.3.0) in `Startup.cs`\n\n### Compatibility\n\n|Swashbuckle Version|ASP.NET Core|Swagger / OpenAPI Spec.|This extension Version|\n|:------------------|:-----------|:----------------------|:---------------------|\n|[master](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/master/README.md)|\u003e= 2.0.0|2.0, 3.0|[master](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/tree/master/README.md)|\n|[6.1.5](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v6.1.5)|\u003e= 2.0.0|2.0, 3.0|[v2.6.1](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/tree/v2.6.1/README.md)|\n|[6.1.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v6.1.0)|\u003e= 2.0.0|2.0, 3.0|[v2.6.0](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/tree/v2.6.0/README.md)|\n|[6.0.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v6.0.0)|\u003e= 2.0.0|2.0, 3.0|[v2.5.1](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/tree/v2.5.1/README.md)|\n|[5.0.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v5.0.0)|\u003e= 2.0.0|2.0, 3.0|[v2.0.0](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/tree/v2.0.0/README.md)|\n|[4.0.0](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/tree/v4.0.0)|\u003e= 2.0.0, \u003c 3.0.0|2.0|[v1.1.4](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/tree/v1.1.4/README.md)|\n\n## Getting Started\n\nTo use the extensions, install [*NuGet* package](https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions/) into your project:\n\n#### Manually with the *NuGet* Package Manager:\n\n```powershell\nInstall-Package Unchase.Swashbuckle.AspNetCore.Extensions\n```\n\n#### Using the .NET CLI:\n\n```powershell\ndotnet add package Unchase.Swashbuckle.AspNetCore.Extensions --version {version}\n```\n\n\u003e Where {version} is the version of the package you want to install. \n\u003e For example, `dotnet add package Unchase.Swashbuckle.AspNetCore.Extensions --version 2.4.0`\n\nThen use whichever extensions (filters) you need.\n\n## Extensions (Filters) use\n\nEnsure your API actions and parameters are decorated with explicit **\"Http\"** and **\"From\"** (optional) bindings.\n\n```csharp\n[HttpPost]\npublic void CreateProduct([FromBody]Product product)\n...\n```\n\n```csharp\n[HttpGet]\npublic IEnumerable\u003cProduct\u003e SearchProducts([FromQuery]string keywords)\n...\n```\n\nIn the `Configure` method, insert middleware to expose the generated Swagger as JSON endpoint(s):\n\n```csharp\napp.UseSwagger();\n```\n\nOptionally, insert the swagger-ui middleware if you want to expose interactive documentation, specifying the Swagger JSON endpoint(s) to power it from:\n\n```csharp\napp.UseSwaggerUI(c =\u003e\n{\n    c.SwaggerEndpoint(\"/swagger/v1/swagger.json\", \"My API V1\");\n});\n```\n\n1. **Fix enums in OpenApi document**:\n- In the _ConfigureServices_ method of _Startup.cs_, inside your `AddSwaggerGen` call, enable whichever extensions (filters) you need:\n\n```csharp\nusing Unchase.Swashbuckle.AspNetCore.Extensions.Extensions;\nusing Unchase.Swashbuckle.AspNetCore.Extensions.Filters;\n```\n\n* \u003ca name=\"breaking-changes-2.3.0\"\u003e\u003c/a\u003e Since [v2.3.0](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/releases/tag/v2.3.0):\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    // Add framework services.\n    services.AddControllers();\n\n    // Register the Swagger generator\n    services.AddSwaggerGen(options =\u003e\n    {\n        options.SwaggerDoc(\"v1\", new OpenApiInfo { Title = \"My API\", Version = \"v1\" });\n\n        // use it if you want to hide Paths and Definitions from OpenApi documentation correctly\n        options.UseAllOfToExtendReferenceSchemas();\n\n        // if you want to add xml comments from summary and remarks into the swagger documentation, first of all add:\n        // you can exclude remarks for concrete types\n        var xmlFilePath = Path.Combine(AppContext.BaseDirectory, \"WebApi3.1-Swashbuckle.xml\");\n        options.IncludeXmlCommentsWithRemarks(xmlFilePath, false,\n            typeof(ComplicatedClass),\n            typeof(InnerEnum));\n\n        // or add without remarks\n        //options.IncludeXmlComments(xmlFilePath);\n\n        // if you want to add xml comments from inheritdocs (from summary and remarks) into the swagger documentation, add:\n        // you can exclude remarks for concrete types\n        options.IncludeXmlCommentsFromInheritDocs(includeRemarks: true, excludedTypes: typeof(string));\n\n        // Add filters to fix enums\n        // use by default:\n        //options.AddEnumsWithValuesFixFilters();\n\n        // or configured:\n        options.AddEnumsWithValuesFixFilters(services, o =\u003e\n        {\n            // add schema filter to fix enums (add 'x-enumNames' for NSwag or its alias from XEnumNamesAlias) in schema\n            o.ApplySchemaFilter = true;\n\n            // alias for replacing 'x-enumNames' in swagger document\n            o.XEnumNamesAlias = \"x-enum-varnames\";\n\n            // alias for replacing 'x-enumDescriptions' in swagger document\n            o.XEnumDescriptionsAlias = \"x-enum-descriptions\";\n\n            // add parameter filter to fix enums (add 'x-enumNames' for NSwag or its alias from XEnumNamesAlias) in schema parameters\n            o.ApplyParameterFilter = true;\n\n            // add document filter to fix enums displaying in swagger document\n            o.ApplyDocumentFilter = true;\n\n            // add descriptions from DescriptionAttribute or xml-comments to fix enums (add 'x-enumDescriptions' or its alias from XEnumDescriptionsAlias for schema extensions) for applied filters\n            o.IncludeDescriptions = true;\n\n            // add remarks for descriptions from xml-comments\n            o.IncludeXEnumRemarks = true;\n\n            // get descriptions from DescriptionAttribute then from xml-comments\n            o.DescriptionSource = DescriptionSources.DescriptionAttributesThenXmlComments;\n\n            // new line for enum values descriptions\n            // o.NewLine = Environment.NewLine;\n            o.NewLine = \"\\n\";\n\n            // get descriptions from xml-file comments on the specified path\n            // should use \"options.IncludeXmlComments(xmlFilePath);\" before\n            o.IncludeXmlCommentsFrom(xmlFilePath);\n            // the same for another xml-files...\n        });\n    });\n}\n```\n\n* For older versions:\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    // Add framework services.\n    services.AddMvc();\n\n    services.AddSwaggerGen(options =\u003e\n    {\n        options.SwaggerDoc(\"v1\", new OpenApiInfo { Title = \"My API\", Version = \"v1\" });\n\n        // if you want to add xml comments into the swagger documentation, first of all add:\n        var filePath = Path.Combine(AppContext.BaseDirectory, \"WebApi3.1-Swashbuckle.xml\");\n        options.IncludeXmlComments(filePath);\n\n        // Add filters to fix enums\n        options.AddEnumsWithValuesFixFilters(true);\n\n        // or custom use:\n        //options.SchemaFilter\u003cXEnumNamesSchemaFilter\u003e(true); // add schema filter to fix enums (add 'x-enumNames' for NSwag) in schema\n        //options.ParameterFilter\u003cXEnumNamesParameterFilter\u003e(true); // add parameter filter to fix enums (add 'x-enumNames' for NSwag) in schema parameters\n        //options.DocumentFilter\u003cDisplayEnumsWithValuesDocumentFilter\u003e(true); // add document filter to fix enums displaying in swagger document\n    });\n}\n```\n\n2. **Hide Paths and Definitions from OpenApi documentation** without accepted roles: \n- In the _ConfigureServices_ method of _Startup.cs_, inside your `AddSwaggerGen` call, enable `HidePathsAndDefinitionsByRolesDocumentFilter` document filter:\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n\n    services.AddSwaggerGen(options =\u003e\n    {\n        ...\n\n        // remove Paths and Defenitions from OpenApi documentation without accepted roles\n        options.DocumentFilter\u003cHidePathsAndDefinitionsByRolesDocumentFilter\u003e(new List\u003cstring\u003e { \"AcceptedRole\" });\n    });\n}\n```\n\n- Since [v2.2.1](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/releases/tag/v2.2.1) you can hide Paths and Definitions from OpenApi documentation for specific controller action (or all actions) without accepted roles like this:\n\n```csharp\n// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\npublic void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n    //...    \n\n    // enable middleware to serve generated Swagger as a JSON endpoint.\n    app.UseSwagger(c =\u003e\n    {\n        c.PreSerializeFilters.Add((openApiDoc, httpRequest) =\u003e\n        {\n            // remove Paths and Components from OpenApi documentation for specific controller action without accepted roles\n            openApiDoc.RemovePathsAndComponentsWithoutAcceptedRolesFor\u003cSomeController\u003e(controller =\u003e nameof(controller.SomeAction), new List\u003cstring\u003e {\"AcceptedRole\"});\n\n            // or\n            //openApiDoc.RemovePathsAndComponentsWithoutAcceptedRolesFor\u003cSomeController\u003e(nameof(SomeController.SomeAction), new List\u003cstring\u003e { \"AcceptedRole\" });\n\n\n            // remove Paths and Components from OpenApi documentation for all controller actions without accepted roles\n            openApiDoc.RemovePathsAndComponentsWithoutAcceptedRolesForController\u003cAnotherController\u003e(new List\u003cstring\u003e {\"AcceptedRole\"});\n\n            // or you can get accepted roles by httpRequest like this:\n            //openApiDoc.RemovePathsAndComponentsWithoutAcceptedRolesForController\u003cAnotherController\u003e(GetAcceptedRolesByRemoteIp(httpRequest.HttpContext.Connection.RemoteIpAddress));\n        });\n    });\n\n    //...\n}\n```\n\nValidated actions must be annotated with the one of `HttpMethodAttribute` (`HttpGetAttribute`, `HttpPostAttribute`, `HttpDeleteAttribute`, `HttpPutAttribute`, `HttpPatchAttribute`) attributes.\n\n3. **Append action count into the SwaggetTag's descriptions in OpenApi document**:\n- In the _ConfigureServices_ method of _Startup.cs_, inside your `AddSwaggerGen` call, enable `AppendActionCountToTagSummaryDocumentFilter` document filter:\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n\n    services.AddSwaggerGen(options =\u003e\n    {\n        ...\n\n        // enable openApi Annotations\n        options.EnableAnnotations();\n\n        // add action count (with message template) into the SwaggerTag's descriptions\n        // you can use it after \"HidePathsAndDefinitionsByRolesDocumentFilter\"\n        options.DocumentFilter\u003cAppendActionCountToTagSummaryDocumentFilter\u003e(\"(count: {0})\");\n\n        ...\n    });\n}\n```\n\nIn the controller need to use `SwaggerTag` attribute:\n\n```csharp\nusing Swashbuckle.AspNetCore.Annotations;\n```\n\n```csharp\n[SwaggerTag(\"Controller for todo\")]\npublic class TodoController : ControllerBase\n...\n```\n\n4. **Change all responses for specific HTTP status codes in OpenApi document**:\n- In the _ConfigureServices_ method of _Startup.cs_, inside your `AddSwaggerGen` call, enable `ChangeAllResponsesByHttpStatusCode\u003cT\u003e` extension (filter) with whichever HTTP status codes you need:\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n\n    services.AddSwaggerGen(options =\u003e\n    {\n        ...\n\n        // change responses for specific HTTP status code (\"200\")\n        options.ChangeAllResponsesByHttpStatusCode(\n            httpStatusCode: 200,\n            responseDescription: \"200 status code description\",\n            responseExampleOption : ResponseExampleOptions.AddNew, // add new response examples\n            responseExample: new TodoItem { Tag = Tag.Workout, Id = 111, IsComplete = false, Name = \"test\" }); // some class for response examples\n        \n        // change responses for specific HTTP status code (\"400\" (HttpStatusCode.BadRequest))\n        options.ChangeAllResponsesByHttpStatusCode(\n            httpStatusCode: HttpStatusCode.BadRequest,\n            responseDescription: \"400 status code description\",\n            responseExampleOption: ResponseExampleOptions.Clear, // claer response examples\n            responseExample: new ComplicatedClass()); // some class for response examples\n        \n        // change responses for specific HTTP status code (\"201\" (StatusCodes.Status201Created))\n        options.ChangeAllResponsesByHttpStatusCode(\n            httpStatusCode: StatusCodes.Status201Created,\n            responseDescription: \"201 status code description\",\n            responseExampleOption: ResponseExampleOptions.None, // do nothing with response examples\n            responseExample: new ComplicatedClass()); // some class for response examples\n\n        ...\n    });\n}\n```\n\n5. **Order tags by name in OpenApi document**:\n- In the _ConfigureServices_ method of _Startup.cs_, inside your `AddSwaggerGen` call, enable `TagOrderByNameDocumentFilter` document filter:\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n\n    services.AddSwaggerGen(options =\u003e\n    {\n        ...\n\n        // order tags by name\n        options.DocumentFilter\u003cTagOrderByNameDocumentFilter\u003e();\n\n        ...\n    });\n}\n```\n\n6. **Add xml comments from summary and remarks into the swagger documentation**:\n\n- Since [v2.4.0](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/releases/tag/v2.4.0) in the _ConfigureServices_ method of _Startup.cs_, inside your `AddSwaggerGen` call, add `IncludeXmlCommentsWithRemarks` option instead of `IncludeXmlComments` option:\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n\n    services.AddSwaggerGen(options =\u003e\n    {\n        ...\n\n        // add xml comments from summary and remarks into the swagger documentation\n        options.IncludeXmlCommentsWithRemarks(\"\u003cxml_File_Full_Path\u003e\");\n\n        // add xml comments from summary and remarks into the swagger documentation\n        // with excluding remarks for concrete types (since v2.4.1)\n        var xmlFilePath = Path.Combine(AppContext.BaseDirectory, \"WebApi3.1-Swashbuckle.xml\");\n        options.IncludeXmlCommentsWithRemarks(xmlFilePath, false,\n            typeof(ComplicatedClass),\n            typeof(InnerEnum));\n\n        ...\n    });\n}\n```\n\n7. **Add xml comments from \u0026lt;inheritdoc/\u0026gt; (from summary and remarks) into the swagger documentation**:\n\n- Since [v2.5.0](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/releases/tag/v2.5.0) in the _ConfigureServices_ method of _Startup.cs_, inside your `AddSwaggerGen` call, add `IncludeXmlCommentsFromInheritDocs` option:\n\n```csharp\n// This method gets called by the runtime. Use this method to add services to the container.\npublic void ConfigureServices(IServiceCollection services)\n{\n    ...\n\n    services.AddSwaggerGen(options =\u003e\n    {\n        ...\n\n        // add xml comments from inheritdocs (from summary and remarks) into the swagger documentation, add:\n        // with excluding concrete types\n        options.IncludeXmlCommentsFromInheritDocs(includeRemarks: true, excludedTypes: typeof(string));\n\n        ...\n    });\n}\n```\n\n## Builds status\n\n|Status|Value|\n|:-----|:---:|\n|Build|[![Build status](https://ci.appveyor.com/api/projects/status/els72xabgex9lntc)](https://ci.appveyor.com/project/unchase/unchase-swashbuckle-aspnetcore-extensions)\n|Tests|[![Build Tests](https://img.shields.io/appveyor/tests/unchase/unchase-swashbuckle-aspnetcore-extensions.svg)](https://ci.appveyor.com/project/unchase/unchase-swashbuckle-aspnetcore-extensions/build/tests)\n|Buid History|![Build history](https://buildstats.info/appveyor/chart/unchase/unchase-swashbuckle-aspnetcore-extensions)\n|GitHub Release|[![GitHub release](https://img.shields.io/github/release/unchase/unchase.swashbuckle.aspnetcore.extensions.svg)](https://github.com/unchase/unchase.swashbuckle.aspnetcore.extensions/releases/latest)\n|GitHub Release Date|[![GitHub Release Date](https://img.shields.io/github/release-date/unchase/unchase.swashbuckle.aspnetcore.extensions.svg)](https://github.com/unchase/unchase.swashbuckle.aspnetcore.extensions/releases/latest)\n|GitHub Release Downloads|[![Github Releases](https://img.shields.io/github/downloads/unchase/unchase.swashbuckle.aspnetcore.extensions/total.svg)](https://github.com/unchase/unchase.swashbuckle.aspnetcore.extensions/releases/latest)\n|Nuget Version|[![NuGet Version](http://img.shields.io/nuget/v/Unchase.Swashbuckle.AspNetCore.Extensions.svg?style=flat)](https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions/) \n|Nuget Downloads|[![Nuget Downloads](https://img.shields.io/nuget/dt/Unchase.Swashbuckle.AspNetCore.Extensions.svg)](https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions/)\n\n## Features\n\n### Fix enums\n\n- Add an output enums integer values with there strings like `0 = FirstEnumValue` without a `StringEnumConverter` in swaggerUI and schema (by default enums will output only their integer values)\n- Add description to each enum value that has an `[Description]` attribute in `swaggerUI` and schema - should use *options.DocumentFilter\\\u003cDisplayEnumsWithValuesDocumentFilter\\\u003e(**true**);* or *options.AddEnumsWithValuesFixFilters(**true**);*\n\n    In [`Swashbuckle SwaggerUI`](https://github.com/domaindrivendev/Swashbuckle):\n\n    ![Enum Description in SwaggerUI](assets/enumDescriptionInSwaggerUI.png)\n\n    In schema `parameters`:\n\n    ![Enum Description in Schema Parameters](assets/enumDescriptionInSchemaParameters.png)\n\n    In schema `definitions`:\n\n    ![Enum Description in Schema Definitions](assets/enumDescriptionInSchemaDefinitions.png)\n\n    To show enum values descriptions you should use `[Description]` attribute in your code:\n\n    ```csharp\n    /// \u003csummary\u003e\n    /// Title enum.\n    /// \u003c/summary\u003e\n    [DataContract]\n    public enum Title\n    {\n        /// \u003csummary\u003e\n        /// None.\n        /// \u003c/summary\u003e\n        [Description(\"None enum description\")]\n        [EnumMember]\n        None = 0,\n\n        /// \u003csummary\u003e\n        /// Miss.\n        /// \u003c/summary\u003e\n        [Description(\"Miss enum description\")]\n        [EnumMember]\n        Miss,\n\n        /// \u003csummary\u003e\n        /// Mr.\n        /// \u003c/summary\u003e\n        [Description(\"Mr enum description\")]\n        [EnumMember]\n        Mr\n    }\n\n    ...\n\n    /// \u003csummary\u003e\n    /// Sample Person request and response.\n    /// \u003c/summary\u003e\n    public class SamplePersonRequestResponse\n    {\n        /// \u003csummary\u003e\n        /// Sample Person title.\n        /// \u003c/summary\u003e\n        public Title Title { get; set; }\n\n        /// \u003csummary\u003e\n        /// Sample Person age.\n        /// \u003c/summary\u003e\n        public int Age { get; set; }\n\n        /// \u003csummary\u003e\n        /// Sample Person firstname.\n        /// \u003c/summary\u003e\n        [Description(\"The first name of the person\")]\n        public string FirstName { get; set; }\n\n        /// \u003csummary\u003e\n        /// Sample Person income.\n        /// \u003c/summary\u003e\n        public decimal? Income { get; set; }\n    }\n    ```\n - Fix enum values in generated by [`NSwagStudio`](https://github.com/RicoSuter/NSwag/wiki/NSwagStudio) or [Unchase OpenAPI Connected Service](https://marketplace.visualstudio.com/items?itemName=Unchase.unchaseopenapiconnectedservice) client classes:\n\n    ```csharp\n    /// \u003csummary\u003eSample Person title.\n    ///\n    /// 0 = None (None enum description)\n    ///\n    /// 1 = Miss (Miss enum description)\n    ///\n    /// 2 = Mr (Mr enum description)\u003c/summary\u003e\n    [System.CodeDom.Compiler.GeneratedCode(\"NJsonSchema\", \"9.13.35.0 (Newtonsoft.Json v11.0.0.0)\")]\n    public enum Title\n    {\n        None = 0,\n    \n        Miss = 1,\n    \n        Mr = 2,\n    \n    }\n    ```\n\n### Hide Paths and Defenitions from OpenApi documentation\n\n- Hide all OpenAPIDocument **Paths** and **Defenitions** without accepted roles:\n\n    ![Hide SwaggerDocument PathItems](assets/hideSwaggerDocumentPathItems.png)\n\n    You should use `AuthorizeAttribute` for methods or controllers:\n\n    ```csharp\n    ...\n    public class SamplePersonController : ControllerBase\n    {\n        // this method will not be hidden with using 'swaggerDoc.HidePathItemsWithoutAcceptedRoles(new List\u003cstring\u003e {\"AcceptedRole\"});'\n        [Authorize(Roles = \"AcceptedRole\")]\n        [HttpGet]\n        public ActionResult\u003cSamplePersonRequestResponse\u003e Get(Title title)\n        {\n            ...\n        }\n\n        // this method will be hidden with using 'swaggerDoc.HidePathItemsWithoutAcceptedRoles(new List\u003cstring\u003e {\"AcceptedRole\"});'\n        [Authorize(Roles = \"NotAcceptedRole\")]\n        [HttpPost]\n        public ActionResult\u003cSamplePersonRequestResponse\u003e Post([FromBody] SamplePersonRequestResponse request)\n        {\n            ...\n        }\n    }\n    ```\n\n### Append action count into the SwaggetTag's descriptions\n\n![Append action count](assets/appendActionCountIntoSwaggerTag.png)\n\nYou should use `SwaggerTagAttribute` for controllers:\n\n```csharp\n[SwaggerTag(\"SamplePerson description\")]\npublic class SamplePersonController : ControllerBase\n{\n    ...\n}\n```\n\n### Change responses for specific HTTP status codes\n\nFor example:\n\n![Change responses](assets/changeResponsesByHttpStatusCode.png)\n\n### Add xml comments from summary and remarks into the swagger documentation\n\n![Add xml comments from summary and remarks](assets/addXmlCommentsFromSummaryAndRemarks.png)\n\nFor code:\n\n```csharp\n/// \u003csummary\u003e\n/// Inner class\n/// \u003c/summary\u003e\n/// \u003cremarks\u003e\n/// Inner class remarks - class\n/// \u003c/remarks\u003e\npublic class InnerClass\n{\n    /// \u003csummary\u003e\n    /// List of inner enums\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// List of inner enums remarks - property\n    /// \u003c/remarks\u003e\n    public List\u003cInnerEnum\u003e InnerEnum { get; set; }\n\n    /// \u003csummary\u003e\n    /// Second inner class\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// Second inner class remarks - property\n    /// \u003c/remarks\u003e\n    public SecondInnerClass\u003cSecondInnerEnum\u003e SecondInnerClass { get; set; }\n}\n\n/// \u003csummary\u003e\n/// Inner enum\n/// \u003c/summary\u003e\n/// \u003cremarks\u003e\n/// Inner enum remarks - enum\n/// \u003c/remarks\u003e\npublic enum InnerEnum\n{\n    /// \u003csummary\u003e\n    /// Inner enum value\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// Inner enum value remarks\n    /// \u003c/remarks\u003e\n    Value = 1\n}\n\n/// \u003csummary\u003e\n/// Second inner class\n/// \u003c/summary\u003e\n/// \u003cremarks\u003e\n/// Second inner class remarks - class\n/// \u003c/remarks\u003e\npublic class SecondInnerClass\u003cT\u003e where T : Enum\n{\n    /// \u003csummary\u003e\n    /// Second inner enum\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// Second inner enum remarks - property\n    /// \u003c/remarks\u003e\n    public T InnerEnum { get; set; }\n}\n\n/// \u003csummary\u003e\n/// Second inner enum\n/// \u003c/summary\u003e\n/// \u003cremarks\u003e\n/// Second inner enum remarks - enum\n/// \u003c/remarks\u003e\npublic enum SecondInnerEnum\n{\n    /// \u003csummary\u003e\n    /// Second inner enum value\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// Second inner enum value remarks\n    /// \u003c/remarks\u003e\n    Value = 0\n}\n```\n\n### Add xml comments from \u0026lt;inheritdoc/\u0026gt; (from summary and remarks) into the swagger documentation\n\n![Add xml comments from ingeritdoc](assets/addXmlCommentsFromInheritdoc.png)\n\nFor code:\n\n```csharp\n/// \u003cinheritdoc cref=\"IInheritDocClass\"/\u003e\npublic class InheritDocClass : IInheritDocClass\n{\n    /// \u003cinheritdoc/\u003e\n    public string Name { get; set; }\n\n    /// \u003cinheritdoc/\u003e\n    public string Common { get; set; }\n\n    /// \u003cinheritdoc/\u003e\n    public InheritEnum InheritEnum { get; set; }\n}\n\n/// \u003csummary\u003e\n/// InheritDocClass - inheritdoc\n/// \u003c/summary\u003e\n/// \u003cremarks\u003e\n/// InheritDocClass remarks - inheritdoc\n/// \u003c/remarks\u003e\npublic interface IInheritDocClass : IInheritDocCommon\n{\n    /// \u003csummary\u003e\n    /// Name - inheritdoc\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// Name remarks - inheritdoc\n    /// \u003c/remarks\u003e\n    public string Name { get; set; }\n}\n\n/// \u003csummary\u003e\n/// IInheritDocCommon interface\n/// \u003c/summary\u003e\n/// \u003cremarks\u003e\n/// IInheritDocCommon interface remarks\n/// \u003c/remarks\u003e\npublic interface IInheritDocCommon\n{\n    /// \u003csummary\u003e\n    /// Common - inheritdoc (inner)\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// Common remarks - inheritdoc (inner)\n    /// \u003c/remarks\u003e\n    public string Common { get; set; }\n\n    /// \u003csummary\u003e\n    /// InheritEnum - inheritdoc (inner)\n    /// \u003c/summary\u003e\n    public InheritEnum InheritEnum { get; set; }\n}\n\n/// \u003csummary\u003e\n/// Inherit enum - enum\n/// \u003c/summary\u003e\n/// \u003cremarks\u003e\n/// Inherit enum remarks - enum\n/// \u003c/remarks\u003e\npublic enum InheritEnum\n{\n    /// \u003csummary\u003e\n    /// Inherit enum Value\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// Inherit enum Value remarks\n    /// \u003c/remarks\u003e\n    Value = 0\n}\n```\n\n## HowTos\n\n- [ ] Add HowTos in a future\n- [ ] ... [request for HowTo you need](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/issues/new?title=DOC)\n\n## Roadmap\n\nSee the [changelog](CHANGELOG.md) for the further development plans and version history.\n\n## Feedback\n\nPlease feel free to add your [request a feature](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/issues/new?title=FEATURE) or [report a bug](https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/issues/new?title=BUG). Thank you in advance!\n\n## Thank me!\n\nIf you like what I am doing and you would like to thank me, please consider:\n\n[![Buy me a coffe!](assets/buymeacoffe.png)](https://www.buymeacoffee.com/nikolaychebotov)\n\nThank you for your support!\n\n----------\n\nCopyright \u0026copy; 2019 [Nikolay Chebotov (**Unchase**)](https://github.com/unchase) - Provided under the [Apache License 2.0](LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funchase%2FUnchase.Swashbuckle.AspNetCore.Extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funchase%2FUnchase.Swashbuckle.AspNetCore.Extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funchase%2FUnchase.Swashbuckle.AspNetCore.Extensions/lists"}