SiddharthBharadwaj / OAPI2HTML

oapi2html is a command-line tool that converts OpenAPI 3.0 YAML files into static HTML files, suitable for hosting on a web server or serving locally. It uses the Jinja2 templating engine to render the YAML data into a customizable HTML template, producing a clean and professional-looking documentation page for your API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OAPI2HTML

This tool was created to solve personal issues while working with Redocly and other API deployment tools. It converts an OpenAPI 3.0 YAML file to a static HTML file that can be hosted on a web server.

Usage

Python 3 should be installed for this to work.

  1. Clone the repository
git clone https://github.com/SiddharthBharadwaj/oapi2html.git
  1. Install the dependencies
cd oapi2html
pip3 install -r requirements.txt
  1. Run oapi2html
python oapi2html.py <input_file> <output_file>

where <input_file> is the path to the OpenAPI YAML file and <output_file> is the path to the HTML output file.

Features

  • Generates a modern and responsive HTML documentation page
  • Supports Bootstrap and CSS styling
  • Includes a search bar to easily find endpoints
  • Displays detailed information for each endpoint, including parameters and responses

Example

To see an example of the HTML output, you can view the scrrenshot below or the example_output.html file included in the repository.

Example Image

Contributing

Pull requests are welcome! Please open an issue first to discuss any changes you would like to make.

About

oapi2html is a command-line tool that converts OpenAPI 3.0 YAML files into static HTML files, suitable for hosting on a web server or serving locally. It uses the Jinja2 templating engine to render the YAML data into a customizable HTML template, producing a clean and professional-looking documentation page for your API.


Languages

Language:HTML 94.9%Language:Python 5.1%