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
33
votes
1 answer

Using @RequestParam annotated method with swagger ui

I am using Springfox libraries to generate documentation for REST service and display it in Swagger UI. I followed the directions in Springfox documentation. I have one controller, which uses parameters from query string and the method is mapped as…
jny
  • 8,007
  • 3
  • 37
  • 56
32
votes
1 answer

enum of objects in swagger UI?

I have an enum of other definitions in my Swagger spec: "action": { "title": "Action", "description": "Action to apply to matching requests", "type": "object", "enum": [ {"delayAction": {"$ref": "#/definitions/delayAction"}}, …
davetropeano
  • 537
  • 1
  • 6
  • 8
32
votes
2 answers

How to specify that a pdf is returned in swagger?

I have a get call in my swagger REST API that needs to return a pdf file. There is no clear example / documentation on how to do this without causing a syntax error. responses: 200: description: Returns PDF schema:…
Scottingham
  • 906
  • 2
  • 11
  • 26
31
votes
8 answers

Swagger UI passing authentication token to API call in header

I am new to Swagger. I am using Swagger UI to generate swagger documentation. I have two API calls. First call is to generate token based on user name and password. Second call needs token generated by first call. How I set that token for second…
Java P
  • 2,241
  • 6
  • 31
  • 45
31
votes
5 answers

Multipart File upload using Springfox and Swagger-ui

I'm using Spring MVC as a rest controller and I've integrated Swagger-ui with my controller using Springfox. I'd like to have a method that is able to upload a file via the Swagger-ui interface. I only need two parameters, a long acting for an…
drumlord
  • 311
  • 1
  • 3
  • 4
31
votes
1 answer

How can I describe complex json model in swagger

I'm trying to use Swagger to describe web-api I'm building. The problem is that I can't understand how to describe complex json object? For example, how to describe this objects: { name: "Jhon", address: [ { type: "home", line1:…
Ido Ran
  • 10,584
  • 17
  • 80
  • 143
30
votes
4 answers

Grouping of API methods in documentation - is there some custom attribute

I have controller like public class UserController : ApiController { [Route("api/user")] IHttpActionResult GetUser() { ... } } public class ResumeController : ApiController { [Route("api/user/resumes")] IHttpActionResult GetResumes() { ...…
Ondrej Svejdar
  • 21,349
  • 5
  • 54
  • 89
30
votes
4 answers

Generating Swagger UI documentation for REST API

I have my REST API developed using JAX-RS/Jersey in Java. I want to convert to/generate Swagger based UI documentation for it. Can anyone please tell me precise/steps in simple way on how to do so? I m sorry but, steps given on their site are little…
user3767923
30
votes
9 answers

Sort API methods in Swagger-UI

I cannot find any working example, how to achieve the following: I want my API methods in the Swagger-UI sorted either by methods (GET-POST-PUT-DELETE) OR/AND alphabetically. So far, all methods are displayed in a random order, even not in the order…
ulrich
  • 1,431
  • 3
  • 17
  • 46
30
votes
8 answers

Using Swagger with Flask

Is there a way to generate a RESTful API in Flask using Swagger?
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
29
votes
7 answers

Suddenly Springfox Swagger 3.0 is not working with spring webflux

Application was working with Springfox Swagger 3.0 few days back. Suddenly it is stopped working. The Jar file which was created before a week is still working but now when we try to build a new Jar file, which is not working, even without any…
29
votes
3 answers

Any Springfox alternatives out there?

Last two years I worked on Spring Boot Applications with Springfox. Springfox generate a documentation and a test ui for your REST API. This was awesome. But actually Springfox project is dead and do not support the newest Spring. I have three…
Tristate
  • 1,498
  • 2
  • 18
  • 38
29
votes
4 answers

Swagger: Add description with ref

I want to add a description to an object property that his definition is referenced. Something like that: newCreditCard: type: object properties: billingPhone: description: Phone number of the card holder …
Jonathan Huet
  • 395
  • 1
  • 4
  • 12
29
votes
8 answers

WebApi controller summary is not showing on Swagger documentation

When I enable this documentation feature through Swagger I'm able to see all kind of information about my documentation but there is no details about my Controller name detail/description. How to show controller documentation content like below…
JARVIS
  • 765
  • 1
  • 8
  • 28
29
votes
4 answers

Adding Basic Authorization for Swagger-UI

I have currently deployed a swagger project but I am having trouble adding some basic authorization to it. Currenty when you click on the "Try it out!" button you are required to log in to an account to access the results. I have an account that I…
Zack Herbert
  • 942
  • 1
  • 16
  • 39