swagger-ui

What is the correct way to download a file via the NSwag Code Generator (angular 2 typescript)

孤者浪人 提交于 2020-08-22 04:36:06
问题 I try to download a file via an angular 2 typescript client. The link generated in Swagger UI works fine, but the generated typescript client does not. The controller looks like this: [HttpGet("export")] [SwaggerResponse((int) HttpStatusCode.OK, Type = typeof(FileContentResult))] [ProducesResponseType(typeof(FileResult), (int) HttpStatusCode.OK)] [Produces("text/csv")] public virtual FileResult Export(int Id, string fileType, CsvFormat format, bool includeHeader) { . . . FileStreamResult file

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

Swagger not loading - Failed to load API definition: Fetch error undefined

吃可爱长大的小学妹 提交于 2020-08-02 04:19:40
问题 Trying to setup swagger in conjunction with a web application hosted on IIS express. API is built using ASP Net Core. I have followed the instructions prescribed on the relevant microsoft help page regarding Swashbuckle and ASP.NET Core. Thus far I have got the swagger page to load up and can see that the SwaggerDoc that I have defined is loading, however no API's are present. Currently am getting the following error: "Fetch error undefined ./swagger/v1/swagger.json" public class Startup { //

Swagger not loading - Failed to load API definition: Fetch error undefined

扶醉桌前 提交于 2020-08-02 04:16:11
问题 Trying to setup swagger in conjunction with a web application hosted on IIS express. API is built using ASP Net Core. I have followed the instructions prescribed on the relevant microsoft help page regarding Swashbuckle and ASP.NET Core. Thus far I have got the swagger page to load up and can see that the SwaggerDoc that I have defined is loading, however no API's are present. Currently am getting the following error: "Fetch error undefined ./swagger/v1/swagger.json" public class Startup { //

Swagger not loading - Failed to load API definition: Fetch error undefined

落花浮王杯 提交于 2020-08-02 04:16:07
问题 Trying to setup swagger in conjunction with a web application hosted on IIS express. API is built using ASP Net Core. I have followed the instructions prescribed on the relevant microsoft help page regarding Swashbuckle and ASP.NET Core. Thus far I have got the swagger page to load up and can see that the SwaggerDoc that I have defined is loading, however no API's are present. Currently am getting the following error: "Fetch error undefined ./swagger/v1/swagger.json" public class Startup { //

Swagger not loading - Failed to load API definition: Fetch error undefined

|▌冷眼眸甩不掉的悲伤 提交于 2020-08-02 04:15:07
问题 Trying to setup swagger in conjunction with a web application hosted on IIS express. API is built using ASP Net Core. I have followed the instructions prescribed on the relevant microsoft help page regarding Swashbuckle and ASP.NET Core. Thus far I have got the swagger page to load up and can see that the SwaggerDoc that I have defined is loading, however no API's are present. Currently am getting the following error: "Fetch error undefined ./swagger/v1/swagger.json" public class Startup { //

Why is the Authorization header missing in requests sent from Swagger UI?

天涯浪子 提交于 2020-07-31 04:50:49
问题 I want to add a documentation to my Node.js API, for this I have a YAML file where I put my definitions, the swagger doc is at localhost:5000/api-doc and working fine. Now I have to add Bearer authorization but Swagger with the following definition: swagger: "2.0" info: version: 1.0.0 title: My API documentation description: > My API documentation host: localhost:5000 basePath: "/v1" schemes: - http securityDefinitions: Bearer: type: apiKey description: "Value: Bearer " name: Authorization in

Why is the Authorization header missing in requests sent from Swagger UI?

橙三吉。 提交于 2020-07-31 04:50:41
问题 I want to add a documentation to my Node.js API, for this I have a YAML file where I put my definitions, the swagger doc is at localhost:5000/api-doc and working fine. Now I have to add Bearer authorization but Swagger with the following definition: swagger: "2.0" info: version: 1.0.0 title: My API documentation description: > My API documentation host: localhost:5000 basePath: "/v1" schemes: - http securityDefinitions: Bearer: type: apiKey description: "Value: Bearer " name: Authorization in

Swagger 2: use enum reference in query parameter of array type

与世无争的帅哥 提交于 2020-07-31 01:36:10
问题 Can not get how to use reference of string type with enum values in array parameter. I can make reference in items key and it is working, but Swagger produce error: Not a valid parameter definition Web UI generates interface, but it have textarea instead of multiselect box I expected. What is the proper way to do it? My code: swagger: '2.0': paths: /test: get: parameters: - in: origin name: status description: Origin required: false schema: type: array items: $ref: '#/definitions/Origin'

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