Questions tagged [swagger]

Swagger is a framework implementation for describing, producing, consuming, and visualizing RESTful web services, based on the OpenAPI specification

Swagger is a specification and framework implementation for describing, producing, consuming and visualizing RESTful web services. It is a unique way to document your RESTful APIs on the go, as and when you code them.

The main advantage of Swagger is its flexibility - it can produce static and dynamic REST API documentation. There is even the possibility to interact with the webservice and send example queries.

It's developed by SmartBear.

On Nov 5th, 2015, the Open API Initiative extended Swagger as an OpenAPI specification to advance connected application development through open standards. Please refer to the announcement for more information.

Useful links

Frequently Asked Questions

People often ask about the following Swagger topics:

Related tags

11997 questions
30
votes
5 answers

Generate Swagger Document for existing NodeJS server

According to Swagger website, there are two approaches: Bottom-up and Top-down. I have an existing NodeJS server that I'd like to deploy in the Azure enviroment, that require a swagger document (API APP). Does anyone know a tool for generating the…
Ernani
  • 1,009
  • 3
  • 15
  • 26
30
votes
3 answers

How to make a field in a definition required for some operations and not others

I'm writing my swagger definition in yaml. Say I have a definition that looks something like this. paths: /payloads: post: summary: create a payload ... parameters: - in: body name: payload description:…
Joseph Downing
  • 1,099
  • 2
  • 12
  • 25
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
8 answers

Circular Dependency with Nestjs Swagger 4

When I updated the @nest/swagger library to version 4, this error happened: (node:16134) UnhandledPromiseRejectionWarning: Error: A circular dependency has been detected (property key: "customer"). Please, make sure that each side of a bidirectional…
btd1337
  • 2,616
  • 2
  • 16
  • 25
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
2 answers

How to use Swagger in ASP.Net WebAPI 2.0 with token based authentication

I have a ASP.Net WebApi with token based authentication and I want to use swagger to create documentation for this RestApi. The Api has for now only 2 methods, one for requesting a token i.e. http://localhost:4040/token and the other one is for…
alaa_sayegh
  • 2,141
  • 4
  • 21
  • 37
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

Swashbuckle parameter descriptions

I'm using SwaggerResponse attributes to decorate my api controller actions, this all works fine, however when I look at the generated documentation the description field for parameters is empty. Is a there an attribute based approach to describe…
Slicc
  • 3,217
  • 7
  • 35
  • 70
29
votes
1 answer

Post a json body with swagger

I would like to POST a json body with Swagger, like this : curl -H "Content-Type: application/json" -X POST -d {"username":"foobar","password":"xxxxxxxxxxxxxxxxx", "email": "foo@bar.com"}' http://localhost/user/register Currently, I have this…
ncrocfer
  • 2,542
  • 4
  • 33
  • 38
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
28
votes
1 answer

Change property type as exported by Swagger/Swashbuckle

I have a fairly complex object with nested objects; please note that in the example below I have simplified this object greatly. Assume the following example object: public class Result { public string Name { get; set; } public IpAddress…
RobIII
  • 8,488
  • 2
  • 43
  • 93