![](/img/trans.png)
[英]Swashbuckle - How do I change the displayed title of the service?
當我使用 swashbuckle 運行 .NET Core 服務時,它顯示的標題(在所有資源之上)源自程序集名稱。 如何指定我自己的標題出現在 swagger 頁面上? (頁面上顯示的標題與文檔標題不同,可以通過傳入app.UseSwaggerUI()方法的options.DocumentTit ...
[英]Swashbuckle - How do I change the displayed title of the service?
當我使用 swashbuckle 運行 .NET Core 服務時,它顯示的標題(在所有資源之上)源自程序集名稱。 如何指定我自己的標題出現在 swagger 頁面上? (頁面上顯示的標題與文檔標題不同,可以通過傳入app.UseSwaggerUI()方法的options.DocumentTit ...
[英]How to replace generic type to concrete type when generating Swagger documentation with Swashbuckle?
我的動作裝飾有: 我需要將生成的響應更改為不同的類型。 所以我添加了一個操作過濾器: 但是生成 swagger json 時通用類型沒有被替換。我在這里缺少什么? ...
[英]Swashbuckle use format identifier via XML comment in .NET application
我正在嘗試獲取在其主頁上說明的 Swagger UI 上打印的格式標識符。 在自動生成的 json 文件中,它應該如下例所示: 我想實現的方法是通過 883812976388 評論在我看來 model class。這適用於example , summary等標簽,但沒有format標簽。 對於 s ...
[英]How to handle <see /> XML documentation tags in Swagger?
我有一個 ASP.Net Web API 和 XML 文檔,包括許多<see />標簽。 我最近在解決方案中添加了 Swagger(Swashbuckle UI 東西),並注意到它不處理像<see />這樣的 XML 標簽。 在網上四處看看后,我發現了這個 - https: ...
[英]How to configure Swagger in Dev/Test and Production environment
我在我的 .NET 6 Web API 項目中配置了 Swagger。 在本地,我可以訪問 Swagger 文件。 下面是我的代碼。 現在,我想在開發、測試和更高的環境中配置它的 URL,例如 https://devurl/api/abc/swagger.yaml。 我正在嘗試上面的代碼,但出現錯 ...
[英]Getting error for Swagger UI with an ASP.NET Core 6 Web API with custom routing
我為我的 ASP.NET Core 6 Web API 定制了路由: 我在 Swagger 配置中進行了此更改: 現在,在嘗試運行瀏覽至http://localhost:5113/ForecastService/swagger/index.html時,出現錯誤: 找不到 http://localho ...
[英]How to disable Swagger authorization for specific endpoints in dotnet app
我有一個使用 do.net core 7 的 web api。我正在使用 JWT 身份驗證。 我有一個 controller 歸因於Authorize 。 該控制器的端點將客戶端重定向到外部資源(來自另一個 API),值得注意的是我將端點歸因於AllowAnonymous 。 我還使用 API 規范 ...
[英]Where is the GetCustomAttributes method of the ActionDescriptor with Swashbuckle in asp.net core 6.0?
老 ASP.NET Web API 2: apiDescription是接口IOperationFilter方法的參數 ASP.NET 核心 6 Web API(不工作): 他們在哪里隱藏了GetCustomAttributes方法? ...
[英]Swagger is throwing exception when ProducesResponseType is used
我正在使用 .Net 7 和 Swagger 作為 Api 和文檔。 我在使用“ProducesResponseType”時遇到問題。 它正在拋出下面的異常。 這是我用來裝飾我的 controller 的東西。 我正在使用的課程如下 我得到的例外是 InvalidOperationException ...
[英]"Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0" - Is [HttpGet] a required attribute in Swagger 3.0?
我正在觀看 .Net 5.0 教程,其中講師定義了兩個沒有 [HttpGet] 屬性的端點(在他的視頻中有效): 我有一個.Net 7.0 項目。 我收到以下兩個端點的以下消息:“Actions require an explicit HttpMethod binding for Swagger ...
[英]Create endpoint in Swagger to validate JWT token
我有一個在 .NET 5.0 中開發的 API,我在其中實現了 Swagger。 現在我有一個端點,用戶在其中獲得一個帶有用戶和密碼的 JWT 令牌,這個令牌用於授權進入 swagger,如下所示: 授權到目前為止一切正常。 但是現在我想實現一個端點,其中用戶必須引入此令牌以授權 swagger 才 ...
[英]Swashbuckle Swagger asking for api-version?
我們已經實現了這里提到的 api 版本控制https://referbruv.com/blog/integrating-aspnet-core-api-versions-with-swagger-ui/ 但是,當它應該知道它是版本 2 時,為什么我們會得到這個 api-version 字段? 我 ...
[英]Add prefix "nameService" to all API Endpoints route, through swagger configuration
我有 API 版本控制 swagger 還有一堆帶路由的controller里面controller的屬性是這樣寫的 一切似乎都很好,但我需要將服務本身的名稱添加到每個方法的路由中有一個解決方案,我必須為每個 controller 手動注冊,但這是錯誤的(我認為)和廢話 Api route expe ...
[英]ASP.NET Core WebAPI - .NET 7: Swagger UI is empty, but still have HTML source
我的項目文件acc.csproj<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net7.0</TargetFramework> < ...
[英]How to display IdentityServer endpoints in SwaggerUI with Swashbucke
我有一個使用 Duende IdentityServer 6 的 ASPNET Core 6 服務,它包括幾個端點,例如 /connect/token 和 /connect/authorize。 我需要這些端點顯示在我的 Swagger UI 頁面中,但是我找不到讓它們顯示的方法。 這是我的AddS ...
[英]Multiple HttpGet that differ by route parameter cannot support different SwaggerResponse's
我正在使用Swashbuckle.AspNetCore.Annotations來增強生成的文檔。 我有一個簡單的 C# controller,它具有標准的 Get、Post、Delete 端點。 當我添加一個帶有路由參數的額外 HttpGet 時,我的問題出現了,這應該足以區分並仍然生成 swag ...
[英]Encode parameter before executing the request
我們正在使用.NET Core 3.1和Swashbuckle.AspNetCore 5.6.3 。 我們的一些 controller 操作需要在請求中發送User-Identity HTTP header。 此User-Identity HTTP header 的值是 base64 編碼的 JSO ...
[英]SwaggerGeneratorException: Ambiguous HTTP method for action error
我有以下 controller (測試目的,它沒有跟隨 REST 與 2 個 GET): 我在那里有 2 個 GET 方法,都沒有使用任何參數。 我嘗試為每個路由和名稱添加一個路由,但 Swagger 仍然顯示錯誤: Swashbuckle.AspNetCore.SwaggerGen.Swagge ...
[英]Use swagger.json file generated in post build actions in Swashbuckle instead of the file generated at runtime
在我的 .NET 6 微服務中,我正在生成 swagger.json 文件與 Swashbuckle post CLI ZEFE90A8E604A7F6B7D 構建命令 ZEFE90A8E604A7F6B78 8 和 8D704A7C840E 構建命令現在我想使用這個 json 而不是 Swashb ...
[英]Why [ApiExplorerSettings(GroupName = "v2")] not work?
我在我的 .NET 6.0 API 中使用 Swagger,並且我想使用不同的 SwaggerEndpoint 來對我的 ZDB974A710D38710D 分組這是我在 Program.cs 中設置的代碼 我在 controller 中設置了屬性[ApiExplorerSettings(Grou ...