Questions tagged [swagger-ui]

Swagger UI is a collection of HTML, CSS and JavaScript objects that dynamically generate documentation from a Swagger-compliant API

Swagger UI is part of the Swagger project.

It adds form to your APIs by making them look good and presentable so that client code can be written easily, at the same time it also makes documentation easier by integrating it with code.

It originated out of the Open API Specification. The source can be found here.

A sample Swagger UI can be found at the Pet Store.

4353 questions
23
votes
2 answers

Specify example requests for swagger's "Try it out"

Is there a way to specify example requests for swagger? Maybe even multiple ones? The Try it out button shows only generic values like: { "firstName": "string", "lastName": "string" } for public class User { public string FirstName {…
t3chb0t
  • 16,340
  • 13
  • 78
  • 118
23
votes
1 answer

How do I set "Parameter content type" using Swashbuckle?

My swagger ui shows "Parameter content type" with various entries: "application/json-patch+json", "text/json", "application/json", and "application/*+json". I only want "application/json". There's a similar unsolved issue on the repo, which uses…
lonix
  • 14,255
  • 23
  • 85
  • 176
23
votes
6 answers

Show only selected controllers in swagger-swashbuckle UI

I am currently using swagger in my project and i have more than 100 controllers there. I guess due to the large number of controller, swagger UI documentation page takes more than 5 min to load its controller. Is it possible to select specific…
Subash Kharel
  • 478
  • 1
  • 3
  • 12
23
votes
3 answers

API key in header with swashbuckle

I want to do API key based authentication on a WebAPI project with Swashbuckle (swagger for .net). I have configured swashbuckle as below: config .EnableSwagger(c => { c.ApiKey("apiKey") .Description("API Key…
undefined
  • 33,537
  • 22
  • 129
  • 198
22
votes
4 answers

How to add summary and body manually in swagger nestjs

I am trying to add summary in my swagger documentation routes but I am not able to find the appropriate decorator for defining the summary. There are some routes in which I have not specified any DTO's. So, I would like to manually add request body…
Istiyak Tailor
  • 1,570
  • 3
  • 14
  • 29
22
votes
4 answers

How to remove swagger production .net core 2.1

I have swagger working on multiple microservices. When deploying to Azure we need to remove all together the option of swagger due to security best practices. Working with .net core 2.1 Looking for example of definitions.
Tzvi Gregory Kaidanov
  • 3,080
  • 3
  • 26
  • 33
22
votes
2 answers

Swagger UI with Multiple Urls

I saw in the swagger ui documentation that you can provide a urls parameter which is: An array of API definition objects ({url: "", name: ""}) used by Topbar plugin. When used and Topbar plugin is enabled, the url parameter will not be parsed.…
zag2010
  • 439
  • 2
  • 4
  • 10
22
votes
3 answers

Swagger 2.0 where to declare Basic Auth Schema

How do I define basic authentication using Swagger 2.0 annotations and have it display in swagger UI. In the resource I have: @ApiOperation(value = "Return list of categories", response=Category.class, responseContainer="List", httpMethod="GET",…
mad_fox
  • 3,030
  • 5
  • 31
  • 43
22
votes
4 answers

How to send Authorization header with a request in Swagger UI?

I have a ASP.NET Web Api 2 application. I added Swashbuckle to it (Swagger for .NET). It displays my endpoints no problem, but in order to send a request I need to attach an Authorization header to that request. If I understand correctly in order to…
Marta
  • 1,132
  • 1
  • 10
  • 26
22
votes
2 answers

How do I get started with swagger-ui

What is swagger-ui and what is the use of it? I have visited http://swagger.io/, but I need more information. Please guide me.
21
votes
4 answers

SwaggerUI not display enum summary description, C# .net core?

I used https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-2.1&tabs=visual-studio#xml-comments to show my classes summaries description in SwaggerUI, it's OK but not show enum summary description…
Mohammad Dayyan
  • 21,578
  • 41
  • 164
  • 232
21
votes
2 answers

What is the difference between SwaggerUIBundle, and SwaggerUi

I've seen both in samples I've found and haven't seen how they are different. Is the bundle needed if you are using this in an HTML page only (not using a single-page-app) or is that the one to use if you are using a single-page-app? The Swagger UI…
PatS
  • 8,833
  • 12
  • 57
  • 100
21
votes
6 answers

Swagger running with local json file in Docker Image

So, I wanted to run the local Swagger UI with respect to Local Json. And for that I am following the instructions available here: Here is the command that is being shared in that documentation: docker run -p 8081:8080 -e…
Ankur Verma
  • 5,793
  • 12
  • 57
  • 93
21
votes
1 answer

OpenAPI multiple types inside an array

I'm having trouble defining a reusable schema component using OpenAPI 3 which would allow for an array that contains multiple types. Each item type inherits from the same parent class but has specific child properties. This seems to work alright in…
Bobbake4
  • 24,509
  • 9
  • 59
  • 94
21
votes
16 answers

swagger-ui No mapping found for HTTP request

I'm trying to document and existing Rest API a Spring MVC project (NOT spring boot!). My application is called api so http://localhost:9090/api would be the root endpoint. Because I'm using spring-data-rest, on that URL I can see the json of all my…
felipe
  • 1,039
  • 1
  • 13
  • 27