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
3 answers

Autorest fails to generate anything, and no error

I am trying the petshop client generation example on github and autorest just exits without creating anything or throwing any errors. Autorest behaves like I did not pass any arguments. Attached is a screenshot of my powershell execution.
busbina
  • 549
  • 1
  • 7
  • 19
5
votes
1 answer

Can Swagger render the content of app.UseDeveloperExceptionPage()?

I have an ASP.NET Core 2.0 Web API where I added Swagger via Swashbuckle. Which is nice. I also have the app.UseDeveloperExceptionPage() option enabled in ASP.NET Core. Which is nice. But they don't play nice together. Because SwaggerUI just…
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124
5
votes
1 answer

Change swagger 2.0 docs path url

This is how I configure swagger : const openapi = Openapi.initialize({ paths: openApiPaths, app, apiDoc, }); const openApiSpec = openapi.apiDoc; console.log(openApiSpec); app.use(swaggerUI(openApiSpec)); How can I change the…
An-droid
  • 6,433
  • 9
  • 48
  • 93
5
votes
0 answers

Swagger UI generation for generic REST calls

What do I want: I want to be able to generate swagger documentation that passes a key/value into the URL. This so that I can use generic arguments controller to handle my requests like Dictionary. If swagger can't generate it, is there a way to…
Tom Droste
  • 1,324
  • 10
  • 14
5
votes
2 answers

How to make the REST service generate a simple string for a Java 8 (Local|Offset)DateTime (when using Swagger)?

Problem: When our REST service returns objects with date/datetime fields, these fields are encoded as complex structures in the JSON format: ... "createdTimestamp": { "offset": { "totalSeconds": 0, "id": "Z", …
5
votes
1 answer

populate parse-server schema with swagger

I'd like use swagger to define a schema/API for parse-server. While I'm new to parse server I'm not sure where to start or even if this is a right approach to import a swagger generated schema to parse-server which can be then updated/extended.
ciekawy
  • 2,238
  • 22
  • 35
5
votes
1 answer

How to set request interceptor in SwaggerUIBundle?

In our swagger.json we are setting basePath to /api, however, when the application is deployed in docker container, the context path is not /api. This could be different thing and we don't know what it is so we can't hard code it. I am trying to…
xbmono
  • 2,084
  • 2
  • 30
  • 50
5
votes
2 answers

Allow an object to have oneOf some types in swagger

I am defining an API and I have a field that is called "payload". We had this field defined as "type": string in our swagger however those payload data begun to have structure. More particular the client sends json objects as payload data that…
cateof
  • 6,608
  • 25
  • 79
  • 153
5
votes
2 answers

specific time format for api documenting using flask restplus

I have an api which accepts start_time, end_time and a boolean closed_all_day in body of the request. from flask_restplus import Namespace, fields timings = api.model('open times', { 'start_time': fields.String(required=True, description='Time…
Mateen-Hussain
  • 718
  • 1
  • 13
  • 29
5
votes
2 answers

How to install Swagger on Ubuntu

I want to install Swagger on Ubuntu. I am new to swagger. I want to do some api documentation by using swagger. For that what are things i need to install on my machine? Please send me the information as soon as possible.
satheesh
  • 107
  • 2
  • 2
  • 9
5
votes
0 answers

Swagger UI not working with OData Controller V3 & WebApi 2

Swashbuckle.OData seems to have integration issues with OData V3 Controllers.I can see the end points on swagger UI, however UI cant fetch the data due to incorrect route prefix 'api' taken by the framework. The end points are working perfectly when…
Suresh Kumar
  • 333
  • 2
  • 10
5
votes
1 answer

C# library for converting json schema to sample JSON

I'm looking for a C# library that will generate a valid JSON object based on a given JSON Schema. I'd like to produce a very simple JSON sample just like how Swagger does it: I've seen some JavaScript libraries like JSON Schema Faker, but I need a…
Tom Schreck
  • 5,177
  • 12
  • 68
  • 122
5
votes
1 answer

Can we set global "consumes" and "produces" in OpenAPI/Swagger 2.0?

In the each path I need to set consumes and produces. Can I set them globally? post: summary: "" description: "" consumes: - "application/json" - "application/xml" produces: - "application/xml" -…
Toxa
  • 63
  • 1
  • 7
5
votes
1 answer

Swashbuckle Swagger UI does not show parameters description

Package version 6.0.0-beta902 Examples : public class TestModel { /// /// This is description of Name /// public string Name { get; set; } } public IActionResult HelloWorld(TestModel model) { return…
Atloka
  • 185
  • 3
  • 12
5
votes
1 answer

auto generate OpenAPI json file in Visual Studio 2017

I am developing Azure Functions in VS2017 5.13 (Preview) and I would like to generate project documentation from the OpenAPI (aka swagger) which i generated from azure portal. The visual studio doesn’t generate the file, so I got the initial file…
Mostafa
  • 3,296
  • 2
  • 26
  • 43