API documentation tools
Swagger 3.0.0 is based on OpenApi Specification.
-
Swagger Editor: Clean and efficient open source editor for designing, describing and documenting API
-
Swagger Codegen: Generate server stub and client sdk from swagger specifications.
-
Swagger UI: Generate visual documentation of API from swagger specifications.
-
Install Swagger Editor
Try web version of swagger editor first: swagger editor online
- Node JS must be installed before installing Swagger Editor.
- Download latest release of swagger editor from it's github repo.
- Deploy swagger-editor folder using any http server i.e
OR
python -m SimpleHTTPServer
Installation using http-server
npm install -g http-server https://github.com/swagger-api/swagger-editor/archive/v3.1.7.zip unzip swagger-editor.zip http-server swagger-editor
-
Writing API Specification
Learn writing your first API specification from it's official docs.
You can try it even from web version of swagger editor. -
Swagger UI
- Go to the GitHub repository of the Swagger UI project
- Clone or download the zip file of the repository
- Go to the folder containing the Swagger UI project in your local machine
- Open the dist folder
- Run the dist/index.html file on a browser or place the dist folder inside your server.
-
Changing default API specification
By default, you can see Petstore API docs. To change it to your API specification follow these steps.- In general, to do so, you would need to pass a constructor URL of the specification you wish to make as the default.
window.swaggerUi = new SwaggerUi({ url: 'https://raw.githubusercontent.com/lf-achyutpkl/swagger-3.0/master/api.yaml' });
- In general, to do so, you would need to pass a constructor URL of the specification you wish to make as the default.