Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swagger-viewer

Small CLI utility for opening an OpenAPI specification in a bundled Swagger UI.

The tool starts a local HTTP server on 127.0.0.1 using a free random port, serves the selected spec file, and opens the Swagger UI page in the default browser.

Supported spec files

swagger-viewer accepts OpenAPI/Swagger specs with these extensions:

  • .json
  • .yaml
  • .yml

When no explicit path is provided, it searches the current directory recursively for one of these common filenames:

  • openapi.json, openapi.yaml, openapi.yml
  • swagger.json, swagger.yaml, swagger.yml
  • spec.json, spec.yaml, spec.yml

Installation

go install github.com/d1vbyz3r0/swagger-viewer@latest

Or build a local binary:

go build -o swagger-viewer .

Usage

Run in a directory that contains an OpenAPI spec:

swagger-viewer

Search for a spec in a specific directory:

swagger-viewer -dir ./api

Open a specific spec file:

swagger-viewer -file ./api/openapi.yaml

About

Small CLI utility for opening an OpenAPI specification in a bundled Swagger UI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages