mk-swagger-ui
v1.0.6
Published
Swagger UI dist generator based on OpenAPI YAML
Downloads
4
Maintainers
Readme
Swagger UI dist generator based on OpenAPI YAML
Overview:
This package provides several simple CLI tools which makes easier to works with Swagger/OpenAPI.
One of tools has same name as the package: mk-swagger-ui
. So you can use it via npx, wihout installing.
For the other tools, you would have to install this npm package first. Then, you would be able to use npx to launch those additional tools.
Run mk-swagger-ui:
- make a new empty folder
- place OpenAPI/Swagger YAML file there. You should have a folder with a single file, e.g.
filename.yaml
- Optionally run:
npm install mk-swagger-ui
npx mk-swagger-ui filename.yaml
What you would get:
- the tool would generate dist folder with static html/js files from
Swagger-UI
package - you can navigate to
http://localhost:3000
to preview theSwagger-UI
package - please view generated
./dist
folder - you can deploy it to a webserver
If you installed the NPM package locally:
You would have a few additional commands, that can be run now via npx
.
If you did not install the package with -g option -- make sure to run npx
command
while being in directory where you installed the package.
npx get-editor
- to get the Swagger Editor package from githubnpx get-ui
- to get the Swagger UI package from githubnpx get-codegen
- to get the Swagger Codegen package from github
Sum up - Results
- The folder
dist
has been created with staticSwagger UI
files - Your OpenAPI YAML file has been converted to JSON format. The JSON file placed to dist folder
Swagger UI
has been configured to use your JSON file- You can host your static files from the
dist
folder on any web server