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

How to define swagger property that is an unknown name?

I need to define a swagger property that doesn't have a known name. { "type": "object", "properties": { "?????": { "type": "array", "items": { "$ref": "#/definitions/ModelRelease" } } } The ????? portion of my…
Nicholas
  • 3,286
  • 5
  • 27
  • 35
25
votes
7 answers

How to specify a generic type class for Swagger API response

I have about 40 APIs that have similar base response structure as follows: { "lastAccessed": "2015-30-08:14:21:45T", "createdOn": "2015-30-07:09:04:10T", "lastModified": "2015-30-08:14:21:45T", "isReadOnly": "false", …
as3rdaccount
  • 3,711
  • 12
  • 42
  • 62
25
votes
6 answers

Unable to bring up swagger-ui from spring-boot application

I have a spring boot application that i am running using embedded tomcat server. I am partially successful in getting springfox-swagger integrated with the app. If i do a /v2/api-docs , i am able to see all the documentation of all the api's in the…
Naveen Chandra
  • 281
  • 1
  • 4
  • 5
25
votes
3 answers

Swagger API which is having query string

I want to deploy an API which is having query string.This is the API v1/products?q=circuit breaker&locale=en-GB&pageSize=8&pageNo=1&project=GLOBAL Here is how i am…
schneider
  • 273
  • 1
  • 3
  • 8
25
votes
2 answers

Swagger: How to have a property reference a model in OpenAPI 2.0 (i.e. nest the models)?

I'm having a hard time trying to figure out how I can nest models in OpenAPI 2.0. Currently I have: SomeModel: properties: prop1: type: string prop2: type: integer prop3: type: $ref: OtherModel OtherModel: …
Henrique Barcelos
  • 7,670
  • 1
  • 41
  • 66
24
votes
6 answers

Swagger UI not displaying when deploying API on IIS

Well, I'm using Swagger for my API documentation and it works perfectly in localhost, the problem begins when I host it on the IIS. For somereason it just doesn't work…
Pedro Leal
  • 439
  • 1
  • 4
  • 9
24
votes
2 answers

Swagger UI configuration with swagger-config.yaml

As per swagger documentation, Swagger-UI accepts configuration parameters in four locations. From lowest to highest precedence: The swagger-config.yaml in the project root directory, if it exists, is baked into the application configuration object…
Mahendra Kapadne
  • 426
  • 1
  • 3
  • 10
24
votes
1 answer

How to define different responses for same HTTP status code in OpenAPI (Swagger)?

I'm writing an OpenAPI spec for an existing API. This API returns status 200 for both success and failure, but with a different response structure. For example, in the signup API, if the user signed up successfully, the API sends status 200 with the…
Nomura Nori
  • 4,689
  • 8
  • 47
  • 85
24
votes
5 answers

cleanest way to glue generated Flask app code (Swagger-Codegen) to backend implementation

I have: a library that does [Stuff] a swagger API definition, which is roughly #1 with minor differences to map cleanly to a REST service a flask app generated #2 using Swagger-Codegen - eg results in python controller functions roughly one-to-one…
some bits flipped
  • 2,592
  • 4
  • 27
  • 42
24
votes
2 answers

How to test a Connexion/Flask app?

I'm using the Connexion framework for Flask to build a microservice. I would like to write tests for my application using py.test. In the pytest-flask doc it says to create a fixture in conftest.py that creates the app like so: conftest.py import…
Sebastian Wozny
  • 16,943
  • 7
  • 52
  • 69
24
votes
7 answers

Automatically generate TypeScript client code for ASP.NET Core controllers

I'm searching for a way to automatically generate the TypesScript client code from a ASP.NET Core Web-Application (Currently using Visual Studio 2017RC and webpack). Are there any existing tools to generate the TypeScript client either in the build…
Fionn
  • 10,975
  • 11
  • 54
  • 84
24
votes
8 answers

Unable to get Swagger UI working with Spring boot

I am trying to get Swagger UI working with Spring Boot 1.2.1. I followed the instructions at https://github.com/martypitt/swagger-springmvc and I added @EnableSwagger on my spring config. I currently get back JSON when I go to…
Wim Deblauwe
  • 25,113
  • 20
  • 133
  • 211
23
votes
6 answers

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry

i'm migrating a modular app into a microsevrices app using spring cloud, when i finished migrating a module into microservice and ran it a problem came up saying : Correct the classpath of your application so that it contains a single, compatible…
Mena_Mena
  • 243
  • 1
  • 2
  • 5
23
votes
2 answers

Replace @EnableSwagger2 after update to latest version

I migrated to latest springfox-swagger2 version 2.10.0 but looks like @EnableSwagger2 is deprecated. What annotation should I use in order to enable Swagger into Spring Boot project? @EnableSwagger2WebMvc?
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
23
votes
4 answers

AWS CDK how to create an API Gateway backed by Lambda from OpenApi spec?

I want to use AWS CDK to define an API Gateway and a lambda that the APIG will proxy to. The OpenAPI spec supports a x-amazon-apigateway-integration custom extension to the Swagger spec (detailed here), for which an invocation URL of the lambda is…
John
  • 10,837
  • 17
  • 78
  • 141