An open API service indexing awesome lists of open source software.

https://github.com/typisttech/swagger_ui_standalone

Generate standalone static Swagger UI sites from OpenAPI specifications.
https://github.com/typisttech/swagger_ui_standalone

openapi static-site-generator swagger-ui

Last synced: 4 months ago
JSON representation

Generate standalone static Swagger UI sites from OpenAPI specifications.

Awesome Lists containing this project

README

          

# Swagger UI Standalone

[![Gem Version](https://img.shields.io/gem/v/swagger_ui_standalone)](https://badge.fury.io/rb/swagger_ui_standalone)
[![Ruby](https://github.com/typisttech/swagger_ui_standalone/actions/workflows/main.yml/badge.svg)](https://github.com/typisttech/swagger_ui_standalone/actions/workflows/main.yml)
[![License](https://img.shields.io/github/license/typisttech/swagger_ui_standalone.svg)](https://github.com/typisttech/swagger_ui_standalone/blob/master/LICENSE.txt)
[![Follow @TangRufus on X](https://img.shields.io/badge/Follow-TangRufus-15202B?logo=x&logoColor=white)](https://x.com/tangrufus)
[![Follow @TangRufus.com on Bluesky](https://img.shields.io/badge/Bluesky-TangRufus.com-blue?logo=bluesky)](https://bsky.app/profile/tangrufus.com)
[![Sponsor @TangRufus via GitHub](https://img.shields.io/badge/Sponsor-TangRufus-EA4AAA?logo=githubsponsors)](https://github.com/sponsors/tangrufus)
[![Hire Typist Tech](https://img.shields.io/badge/Hire-Typist%20Tech-778899)](https://typist.tech/contact/)


Generate standalone static Swagger UI sites from OpenAPI specifications.




Built with ♥ by Typist Tech

---

## Quick Start

```bash
# Install the gem
gem install swagger_ui_standalone

# Prepare some custom files
mkdir custom

## Download some OpenAPI specifications
wget https://raw.githubusercontent.com/github/rest-api-description/refs/heads/main/descriptions/api.github.com/api.github.com.yaml -O custom/github.yaml
wget https://validator.swagger.io/validator/openapi.json -O custom/validator.yaml

## Make a disallow all robots.txt file
cat > custom/robots.txt < custom/swagger-initializer.js <
# Default: swagger-api/swagger-ui
[--ref=TAG|BRANCH|SHA] # Git reference to download (can be a tag, branch or commit SHA). Omit to use the latest release
[--force] # Overwrite files that already exist

Generate standalone static Swagger UI
```

### `download`

```console
$ swagger_ui_standalone help download
Usage:
swagger_ui_standalone download [options] --output=DIRECTORY

Options:
--output=DIRECTORY # Where to write the generated files
[--repo=OWNER/REPO] # GitHub repository to download in the format
# Default: swagger-api/swagger-ui
[--ref=TAG|BRANCH|SHA] # Git reference to download (can be a tag, branch or commit SHA). Omit to use the latest release
[--force] # Overwrite files that already exist

Download standalone static Swagger UI source code
```

## Installation

Install the gem and add to the application's Gemfile by executing:

```bash
bundle add swagger_ui_standalone
```

If bundler is not being used to manage dependencies, install the gem by executing:

```bash
gem install swagger_ui_standalone
```

## Credits

[`Swagger UI Standalone`](https://github.com/typisttech/swagger_ui_standalone) is a [Typist Tech](https://typist.tech) project and
maintained by [Tang Rufus](https://x.com/TangRufus), freelance developer [for hire](https://typist.tech/contact/).

Full list of contributors can be found [on GitHub](https://github.com/typisttech/swagger_ui_standalone/graphs/contributors).

## Copyright and License

This project is a [free software](https://www.gnu.org/philosophy/free-sw.en.html) distributed under the terms of
the MIT license. For the full license, see [LICENSE](./LICENSE.txt).

## Contribute

Feedbacks / bug reports / pull requests are welcome.