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

Cannot find type name in schema definitions

I've started using Swashbuckle with Web API. None of my types are getting rendered correctly in my Swagger UI. On every method, I see something like this (unrendered): Typename is not defined! So I investigated, and…
user47589
5
votes
0 answers

Swagger/OpenAPI multiple security requirements and side effects?

I am implementing a code generator for Swagger/OpenAPI. However, I run into a problem implementing the security requirement. These requirements are defined as a list of objects. The list members are alternatives (or) and the object members are…
Peter Kriens
  • 15,196
  • 1
  • 37
  • 55
5
votes
3 answers

Swagger annotation to get authorize button

I am using swagger to document my java REST API. X-Auth-Token should be send in a header of each api (except one). I would like to have the button like in the pet store V2 of authorize. Can be found here: http://petstore.swagger.io/ I understood…
sosolo
  • 121
  • 1
  • 1
  • 9
5
votes
2 answers

Swagger UI causes failure in Multipart-FormData request from spring-resources with file and json-object

I'm using spring-boot in the version 1.4.3 in my project. The Project provides some REST-endpoints and uses springfox-swagger 2.6.1 to generate the api-documentation. This works just fine for almost all of my requests and I can successfully try the…
Sulu
  • 51
  • 1
  • 6
5
votes
0 answers

Nested URL not showing in Django Rest Swagger

I'm trying to document my Django REST API using Django Rest Swagger. My main url conf looks like this: urlpatterns =[ url(r'^tickers/', include('tickerapi.urls')), ] and tickerapi/urls: schema_view = get_swagger_view(title='Ticker…
5
votes
1 answer

Object is not a primitive for response message models

I decorated an action as follows [SwaggerResponse(HttpStatusCode.OK, "List of customers", typeof(List))] [SwaggerResponse(HttpStatusCode.NotFound, Type = typeof(NotFoundException))] The OK model is shown correctly. However, under…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
5
votes
0 answers

How to pass array of string as parameters in swagger ui

Below is the REST api which i want to document using Swagger UI @ApiOperation( nickname = "alertForBundleId", value = "alertForBundleId", notes = "", httpMethod = "GET") def…
Amit Kumar
  • 53
  • 8
5
votes
1 answer

Swagger documentation for facebook graph api

Can we build a swagger definition in a json format for facebook graph api?
Red
  • 127
  • 6
5
votes
2 answers

Update JSON file without destroying JSON format

I'm trying to update a Swagger JSON document in Powershell. I need to add a couple of properties and values if they do not already exist on the object. The code for doing this is pretty simple: $swaggerDoc = (Get-Content $filePath -raw |…
mclark1129
  • 7,532
  • 5
  • 48
  • 84
5
votes
2 answers

Unable to use generated client from swagger api

I am trying to use a third party api in the project where the way to access those apis are provide in swagger When i generate the client using swagger and try to use in my local i am getting the error has io.swagger.client.ApiException:…
dhana lakshmi
  • 847
  • 1
  • 12
  • 29
5
votes
2 answers

How to refer to an external JSON file containing response examples in Swagger?

In my Swagger spec file, I want to return example responses, for that I can add examples in response. But that makes my spec file quite big and error prone. Is there a way to refer to a file containing JSON of an example object? I tried something…
zodi91
  • 150
  • 1
  • 11
5
votes
1 answer

Indicate required properties of complex input parameter object in Swagger UI

In this method /// /// Gets activity logs. /// /// Location id. /// Activity log filter options. ///
GorvGoyl
  • 42,508
  • 29
  • 229
  • 225
5
votes
0 answers

swagger-codegen files location

I am playing with swagger-codegen on a project and I end up asking myself a question: Is there any convention for the location of the swagger files? Here is my case: I'm using Maven for my project, so I have the standard Maven…
Xendar
  • 466
  • 1
  • 6
  • 15
5
votes
1 answer

Response not loading when using utf-8 chars in header with spring-boot rest and Swagger

I have spring boot-application with swagger. When I am testing my rest services with no utf-8 chars in header everything works OK. Swagger generate command which I can use to test it: curl -X GET --header 'Accept: application/json' --header 'user:…
hudi
  • 15,555
  • 47
  • 142
  • 246
5
votes
1 answer

How to define array-of-objects as parameter?

I am quite new to Swagger, so this might be a basic question. I am able to create .yml file for an API which takes an array of integers as parameter, as follows: Add samples --- tags: - MY API parameters: - name: my_id in: path type:…
Bhushan
  • 18,329
  • 31
  • 104
  • 137