{"id":41284024,"url":"https://github.com/funny-bytes/openapi2html","last_synced_at":"2026-01-23T02:58:35.400Z","repository":{"id":41606724,"uuid":"120212332","full_name":"funny-bytes/openapi2html","owner":"funny-bytes","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-16T13:53:56.000Z","size":1376,"stargazers_count":2,"open_issues_count":12,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T12:45:53.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funny-bytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-04T18:43:49.000Z","updated_at":"2025-01-16T13:47:41.000Z","dependencies_parsed_at":"2024-06-20T18:57:49.261Z","dependency_job_id":"0e7ef152-bf5b-45fd-abd4-efb6c8d5c8b7","html_url":"https://github.com/funny-bytes/openapi2html","commit_stats":null,"previous_names":["frankthelen/openapi2html"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/funny-bytes/openapi2html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funny-bytes%2Fopenapi2html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funny-bytes%2Fopenapi2html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funny-bytes%2Fopenapi2html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funny-bytes%2Fopenapi2html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funny-bytes","download_url":"https://codeload.github.com/funny-bytes/openapi2html/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funny-bytes%2Fopenapi2html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28679139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"online","status_checked_at":"2026-01-23T02:00:08.296Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-23T02:58:34.952Z","updated_at":"2026-01-23T02:58:35.392Z","avatar_url":"https://github.com/funny-bytes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openapi2html\n\nYet another static html generator for Open API 2.0 / Swagger 2.0. It generates Bootstrap 4 compatible static html from your Swagger API spec. Not all the Swagger features are supported -- if you miss anything, let me know.\n\n![main workflow](https://github.com/funny-bytes/openapi2html/actions/workflows/main.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/funny-bytes/openapi2html/badge.svg?branch=master)](https://coveralls.io/github/funny-bytes/openapi2html?branch=master)\n[![dependencies Status](https://david-dm.org/funny-bytes/openapi2html/status.svg)](https://david-dm.org/funny-bytes/openapi2html)\n[![Maintainability](https://api.codeclimate.com/v1/badges/cd10c9d71a7f675c43dc/maintainability)](https://codeclimate.com/github/funny-bytes/openapi2html/maintainability)\n[![node](https://img.shields.io/node/v/openapi2html.svg)]()\n[![code style](https://img.shields.io/badge/code_style-airbnb-brightgreen.svg)](https://github.com/airbnb/javascript)\n[![License Status](http://img.shields.io/npm/l/openapi2html.svg)]()\n\n## Install\n\n```bash\nnpm install openapi2html\n```\n\n## Usage\n\nFirst, use `swagger-parser` to parse your api from `json` or `yaml`. Then, use `openapi2html` to generate html, e.g.:\n```js\nconst parser = require('swagger-parser');\nconst openapi2html = require('openapi2html');\n\n...\nconst api = await parser.parse('my-api.yaml');\nconst html = openapi2html(api);\n```\n\n## Options\n\n`openapi2html` may take a second parameter for options, e.g.:\n```js\n...\nconst options = {\n  tagColors: {\n    pet: 'primary',\n    store: 'warning',\n    user: 'success'\n  },\n  show: {\n    host: false\n  }\n};\nconst html = openapi2html(api, options);\n```\nThere are the following options:\n* `tagColors` maps your operations' tags to Bootstrap theme colors `primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark`. Please do not use `danger` because this is already used for `deprecated`. The default theme color is `secondary`. If you use custom colors, you need to provide the according CSS classes, e.g., `badge-mycolor`. Hex color values are not supported.\n* `show` is used for switching on or off certain information. The following is supported: `version` (default `true`), `host` (default `true`), `basePath` (default `true`), `contact` (default `false`), `license` (default `false`), `termsOfService` (default `false`), `schemes` (default `true`), `consumes` (default `true`), `produces` (default `true`)\n\n## Styling\n\nThe generated html doesn't provide any styling. It is plain Bootstrap 4 compatible html, i.e.,\nit uses `\u003ch1\u003e` through `\u003ch6\u003e`, `\u003ccode\u003e`, `\u003ca\u003e`, as well as Bootstrap's Card and Badge components.\nIn addition, there are classes `o2h-*` attached such as\n`o2h-operation-get` to allow some customized styling.\n\nThis is what worked for me:\n```html\n\u003chtml\u003e\n\u003chead\u003e\n  ...\n  \u003clink href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css\" rel=\"stylesheet\"\u003e\n  \u003cstyle\u003e\n    .card {\n      margin-bottom: 1rem;\n    }\n    .h2, h2 {\n      margin-top: 1rem;\n    }\n    .h4, h4 {\n      margin-top: .5rem;\n    }\n    .card .card-body .h4, .card .card-body h4 {\n      border-top: 1px solid #eee;\n      margin-top: 1rem;\n      padding-top: 1rem;\n    }\n    .card .card-body .h5, .card .card-body h5 {\n      margin-top: 1rem;\n    }\n    .o2h-description p {\n      color: grey;\n      margin-bottom: .5rem;\n    }\n    .card .card-body .o2h-description p {\n      margin-bottom: 0;\n    }\n    .card .card-body .o2h-example pre {\n      background-color: #eee;\n    }\n    .o2h-parameter h5 .badge {\n      font-size: small;\n    }\n  \u003c/style\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cdiv class=\"container\"\u003e\n    \u003c!-- include api html here --\u003e\n  \u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunny-bytes%2Fopenapi2html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunny-bytes%2Fopenapi2html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunny-bytes%2Fopenapi2html/lists"}