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

How to print a Swagger / OpenAPI Spec beautiful

we are new in Swagger / Open API v2.0. Our first API spec is ready. Now we have problems to print out the Spec beautiful. Export from UI are not useful for print. And Google don't help. How do you do that? Knows anyone some good tools? Thank you for…
Burner
  • 981
  • 19
  • 41
5
votes
3 answers

Swagger codegen ignore null fields for POJO classes

I'm making a REST API and I would like to add at the class generation the Jackson annotation to ignore null fields, so I would like to add this annotation onfly for certain classes, not for the hole project. I know that this could be acomplished by…
Florin Lei
  • 521
  • 8
  • 16
5
votes
4 answers

Swagger: Spring MVC models in GET request

In MVC, you would expect that controller will receive models as input and produce models as output. In Swagger, the latter is not a problem but I have troubles with former. I can't understand how to make Swagger build an input model from incoming…
alamar
  • 18,729
  • 4
  • 64
  • 97
5
votes
1 answer

Flasgger - Upload File

I am working on a project that requires to upload a file via flasgger UI. I modified my conf based on Swagger docs but doesn't seem to work. Below is my conf. Please, let know the mistake. """ This API let's you train word embeddings Call this…
5
votes
1 answer

How to Swagger Annotate a Spring GET @RequestMapping having a complex Object

The issue is that I have a complex Object as Request Param for a GET-Request and after I place the Swagger Annotations inside the Object. The Swagger UI shows that the entry param is a body in which i have to place the Params. body: { …
Maevy
  • 261
  • 4
  • 24
5
votes
2 answers

Where the Swagger pretty HTML code?

There are only ugly HTML pages as download (HTML, HTML2 and dynamic all ugly), but the site, eg. edited https://app.swaggerhub.com/apis/{user}/{project}/{version} (and many others!) offers pretty HTML interface... How to download this pretty…
Peter Krauss
  • 13,174
  • 24
  • 167
  • 304
5
votes
4 answers

Spring Boot Swagger API not working

Here's my pom.xml: io.springfox springfox-swagger2 2.7.0 io.springfox
Richard
  • 5,840
  • 36
  • 123
  • 208
5
votes
4 answers

Swagger .NETCORE can't read json

I'm having a trouble with swagger in .netcore. I've tried everything and nothing. I saw another similar questions, but nothing works for me. Running my webapi app with swagger, always returns "Can't read swagger JSON from…
Leila
  • 318
  • 1
  • 4
  • 15
5
votes
3 answers

how to uploading Iformfile with other model properties in asp.net core webapi?

i am trying to post the file using IFormfile & other property models data in asp.net core web api using swagger but i am getting any way to do both the things(uploading file and other model properties) simultaneously. please suggest me some good way…
5
votes
3 answers

Swagger-ui keeps showing example petstore instead of provided swagger.json

I followed instructions to set up swagger documentation for my existing node API using swagger-jsdoc. The swagger.json is being served correctly and I added a path to it in the url parameter of the SwaggerUiBundle in index.html like this: const ui =…
md2312
  • 121
  • 1
  • 1
  • 5
5
votes
2 answers

Generating SQL Server DB from Swagger WebAPI Project

Having found Swagger and generated a WebAPI project for the 'pets' example, I figured the next logical step would be to generate the backend DB. However none of the tutes I've come across recommend an approach for this. I see there are…
Glinkot
  • 2,924
  • 10
  • 42
  • 67
5
votes
2 answers

Swagger and JWT Token Authentication

I am building some Swagger documentation, all well and good, except that I am wanting to have the page work interactively, so when selecting the editor or UI, if I hit the authorize button, I would call my Authentication URL that builds the JWT…
Inquisitor Shm
  • 1,433
  • 5
  • 17
  • 26
5
votes
2 answers

Swagger avoid removing common prefix

How to skip removing the common prefix from modelsEnum name? I have got an enum with single value (in the future I will have more values) and swagger code gen plugin generates the class with enum CODE instead of AIRPORT_CODE properties: type: …
gauee
  • 305
  • 3
  • 13
5
votes
2 answers

Swagger UI Displays but I get an "ERROR" indicator

My swagger UI displays and it is showing all of my routes. Everything looks great except there is a big red ERROR indicator on the lower right. When I click it I get: { "schemaValidationMessages":[ { "level":"error", …
user3508811
  • 847
  • 4
  • 19
  • 43
5
votes
3 answers

No "Try it out" button for HEAD method in Swagger UI

I have a Swagger spec that defines a HEAD operation: head: description: show flight exist or not. parameters: - name: flight_no in: path type: string description: Flight_no required: true produces: -…
Ravi Bhushan
  • 942
  • 2
  • 11
  • 19