One html file that generate swagger UI by loading any given swagger spec. Even not connect to the Internet.
Took and modified slightly from here.
Only support swagger-spec 2.0 (OpenAPI spec 2.0) now.
NOTE: Only useable directly on Windows. For other OS please modified the file path field specifying the spec. See 'Config' section below.
- Download this repo as a zip file and unzip it.
- Just open 'offline-swagger-ui.html' with Edge or Firefox. 'petstore.yaml' will be loaded by default as an example.
You can place your own swagger spec files into the directory which 'offline-swagger-ui.html' resides in and change url
field of the Swagger UI constructor in the html (almost at the end) to your yaml link. If your OS is not Windows, please check the correct way of specifying a local file and then change url
field to fit your need.
Of course you can also change the url
field to any spec file available on the Internet such as this.
- Google Chrome does not load local files by default due to security reasons. The following links may help: