swashbuckle

Net Core: Swashbuckle Set operationId Automatically on to Controller Action Method

喜你入骨 提交于 2020-08-10 03:37:53
问题 We are trying to override Swashbuckle/Swagger IO CodeGen naming conventions, when its creating Angular API Service Proxies, for existing 500+ controllers and the corresponding methods. Currently linking Net Core 3 APIs with Angular Typescript. https://stackoverflow.com/a/58567622/13889515 The following answer works: [HttpGet("{id:int}", Name = nameof(GetProductById))] public IActionResult GetProductById(int id) // operationId = "GetProductById"' [HttpGet("{id:int}", Name = "GetProductById")]

How to change https://<your-url>/swagger to custom in Swagger

余生长醉 提交于 2020-08-06 12:16:48
问题 I was tasked to install Swagger into Web API project. Installed: most recent version of Swashbuckle from nuget. (Swashbuckle.Core.Net45 and Swashbuckle.Net45) Customized: App_Start\SwaggerConfig.cs. I was able to customize (change styles, added logo, modified descriptions).. Now we need to change from https://[your-url]/swagger to https://[your-url]/help Please advise 回答1: Change routePrefix of SwaggerUIOptions parameter, default is "swagger" 回答2: How about following the documentation? In

Show HTTP request duration in Swagger UI

三世轮回 提交于 2020-07-30 03:03:05
问题 Swagger UI has the displayRequestDuration parameter to show how long a request takes. It's disabled by default. How can this be enabled in the SwaggerConfig.cs configuration when using Swashbuckle (the not-core version)? I see this is possible in the Java version. 回答1: According to the documentation, this is a Swagger UI configuration. For my .Net Core app, I was able to get the Request duration with the following code. app.UseSwaggerUI(c => { c.DisplayRequestDuration(); .... (other

Show HTTP request duration in Swagger UI

試著忘記壹切 提交于 2020-07-30 03:02:05
问题 Swagger UI has the displayRequestDuration parameter to show how long a request takes. It's disabled by default. How can this be enabled in the SwaggerConfig.cs configuration when using Swashbuckle (the not-core version)? I see this is possible in the Java version. 回答1: According to the documentation, this is a Swagger UI configuration. For my .Net Core app, I was able to get the Request duration with the following code. app.UseSwaggerUI(c => { c.DisplayRequestDuration(); .... (other

Swagger errors shows a need to define a parameter in the path or operation level

僤鯓⒐⒋嵵緔 提交于 2020-07-23 09:40:03
问题 I am getting the error below: Declared path parameter "imageId" needs to be defined as a path parameter at either the path or operation level This is the snapshot of my swagger definition '/api/v1/images/{unitnumber}/{type}/{imageId}': delete: tags: - Images summary: 'Summary' description: "Description" operationId: DeleteImage consumes: [] produces: - application/json parameters: - name: unitnumber in: path required: true type: string - name: type in: path required: true type: string - name:

Swagger errors shows a need to define a parameter in the path or operation level

核能气质少年 提交于 2020-07-23 09:38:05
问题 I am getting the error below: Declared path parameter "imageId" needs to be defined as a path parameter at either the path or operation level This is the snapshot of my swagger definition '/api/v1/images/{unitnumber}/{type}/{imageId}': delete: tags: - Images summary: 'Summary' description: "Description" operationId: DeleteImage consumes: [] produces: - application/json parameters: - name: unitnumber in: path required: true type: string - name: type in: path required: true type: string - name:

Swagger errors shows a need to define a parameter in the path or operation level

亡梦爱人 提交于 2020-07-23 09:37:05
问题 I am getting the error below: Declared path parameter "imageId" needs to be defined as a path parameter at either the path or operation level This is the snapshot of my swagger definition '/api/v1/images/{unitnumber}/{type}/{imageId}': delete: tags: - Images summary: 'Summary' description: "Description" operationId: DeleteImage consumes: [] produces: - application/json parameters: - name: unitnumber in: path required: true type: string - name: type in: path required: true type: string - name:

How to document API Key authentication using Swashbuckle.AspNetCore v5.0.0-rc2

两盒软妹~` 提交于 2020-07-19 18:51:08
问题 I am migrating a Web API that has Swagger documenation generated using Swashbuckle from .NET Framework to ASP.NET Core. In the new AspNetCore version I'm using Swashbuckle.AspNetCore v5.0.0-rc2. This is an internal service and authentication uses an API key provided in a custom HTTP header. In the .NET Framework application, I configured Swashbuckle to enable my API key as follows: c.ApiKey("apiKey") .Description("My description") .Name("MyHttpHeaderName") .In("header); and c

How to document API Key authentication using Swashbuckle.AspNetCore v5.0.0-rc2

亡梦爱人 提交于 2020-07-19 18:50:20
问题 I am migrating a Web API that has Swagger documenation generated using Swashbuckle from .NET Framework to ASP.NET Core. In the new AspNetCore version I'm using Swashbuckle.AspNetCore v5.0.0-rc2. This is an internal service and authentication uses an API key provided in a custom HTTP header. In the .NET Framework application, I configured Swashbuckle to enable my API key as follows: c.ApiKey("apiKey") .Description("My description") .Name("MyHttpHeaderName") .In("header); and c