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
21
votes
2 answers

Swagger: wildcard path parameters

I have an API which allows any arbitrary path to be passed in, for example all of these: /api/tags /api/tags/foo /api/tags/foo/bar/baz Are valid paths. I tried to describe it as follows: /tags{tag_path}: get: parameters: - name:…
Dmitry Frank
  • 10,417
  • 10
  • 64
  • 114
21
votes
5 answers

How to show XML comments of class properties in Swagger (MVC 6 Web API JsonResult)

I've added XML comments to my class members but Swagger won't show them in the UI. Am I doing something wrong? UPDATE: It looks like you can't document your model classes in Swashbuckle (5.5.3) with @ApiModel and @ApiModelProperty annotations…
user405723
  • 481
  • 3
  • 7
  • 21
21
votes
3 answers

How to define empty array in swagger

I know how to make array of string data in swagger like this: "photoUrls" : { "type":"array", "items":{ "type":"string" } } It will show output like this: "photoUrls":[ "string" ] How to make output like…
smftr
  • 923
  • 3
  • 17
  • 31
20
votes
7 answers

How to change swagger-ui.html default path

I wanna change my swagger-ui path from localhost:8080/swagger-ui.html to localhost:8080/myapi/swagger-ui.html in springboot redirect is helpless to me
Chen Zhang
  • 201
  • 1
  • 2
  • 3
20
votes
1 answer

How to DRY when using Swagger UI and the ApiResponses annotations with Java Spring endpoints?

I like Swagger because it makes your apis very user friendly. I use Swagger annotations like @ApiParam @ApiResponse | @ApiResponses @ApiOperation Others On endpoints, query params, request params, request body and so on. I like to keep my…
Raf
  • 7,505
  • 1
  • 42
  • 59
20
votes
2 answers

swagger date field vs date-time field

I am using swagger to test my rest api, one of the property of my entity class is a date field for which I need the date in yyyy-mm-dd format , but swagger model schema is showing this field as date-time instead of date field, therefore it gives…
Sourav
  • 416
  • 1
  • 5
  • 13
20
votes
2 answers

How to show WebApi OAuth token endpoint in Swagger

I've created a new Web Api project, added Asp.Net Identity and configured OAuth like so: OAuthOptions = new OAuthAuthorizationServerOptions { TokenEndpointPath = new PathString("/Token"), Provider = new…
Russ
  • 207
  • 3
  • 6
20
votes
4 answers

Swagger (Swashbuckle) hide header

I use Swashbuckle to add Swagger documentation to my ASP.NET Web API project. How can I hide default header (with swagger logo) from documentation page without injecting CSS?
ranquild
  • 1,799
  • 1
  • 16
  • 25
19
votes
4 answers

.Net Core 3.1 Remove Schema on Swagger UI

I have .Net 3.1 Web Api, I would like to remove this sections "Schemas" on Swagger UI. How to do it?
Herman
  • 2,832
  • 6
  • 25
  • 37
19
votes
6 answers

Request body not showing in Nest.js + Swagger

My controller code is something like this. @Controller('customer') export class CustomerController{ constructor(private readonly customerService: CustomerService){} @Post('lookup') async someMethod(@Body() body:any){ …
p0tta
  • 1,461
  • 6
  • 28
  • 49
19
votes
6 answers

Wrong "Generated server url" in springdoc-openapi-ui (Swagger UI) deployed behind proxy

Spring Boot 2.2 application with springdoc-openapi-ui (Swagger UI) runs HTTP port. The application is deployed to Kubernetes with Ingress routing HTTPS requests from outside the cluster to the service. In this case Swagger UI available at…
Eugene Khyst
  • 9,236
  • 7
  • 38
  • 65
19
votes
1 answer

why swagger raises unclear error - Django

I have a django rest Backend app, and i use swagger to look and document my apis to the FE. This worked fine, but I made some changes and now I get this error: Internal Server Error: / Traceback (most recent call last): File…
NotSoShabby
  • 3,316
  • 9
  • 32
  • 56
19
votes
8 answers

Integrating HealthCheck endpoint into swagger (open API) UI on dotnet core

I am using Dotnet Core healthchecks as described here. In short, it looks like this: First, you configure services like this: services.AddHealthChecks() .AddSqlServer("connectionString", name: "SQlServerHealthCheck") ... // Add multiple…
eddyP23
  • 6,420
  • 7
  • 49
  • 87
19
votes
7 answers

Does Swagger (Asp.Net Core) have a controller description?

I'm building a REST service that will host multiple controllers (microservices). As a whole, lets call the service "Bob". So swagger displays "Bob" / "A collection of Bob Microservices". Then the controller names are listed. Right now, it just shows…
SledgeHammer
  • 7,338
  • 6
  • 41
  • 86
19
votes
1 answer

How to define role/permission security in Swagger

In my API documentation, I would like to define the security necessary for each API endpoint. The project has defined roles and permissions that determine which users can access the APIs. What is the best way in Swagger to document this…
whatsTheDiff
  • 658
  • 2
  • 7
  • 19