Publish API docs
Docs from the contract, in a site or your portal
Documentation written by hand falls behind the API it describes. Build it from the contracts instead: the REST API and its events in one site, or a reference inside the portal you already have.
- The REST API and its events on one siteOpenAPI and AsyncAPI contracts in one site, or GraphQL and Protobuf, each API under its own path, built from the same files the linter checks and the server mocks.
- Part of your portalStandard custom elements that work in plain HTML, a CMS or any framework, themed to look like the rest of your site.
- Try it out, on the pageReaders send requests from the reference, with API keys, Basic and Bearer auth, OAuth 2.0 or OpenID Connect, and see the answer.
The REST API and its events, from one command
apigenie-generator docs builds one site from the OpenAPI and AsyncAPI contracts: a page per API, operation, schema, channel and message, prerendered, with search and Try it out. <apg-api-reference> renders the same reference in a page of yours. Download the Carpet Express OpenAPI file and AsyncAPI file to build this site yourself; the service is fictional and its endpoints aren't live.
Open the screenshot at full size$ apigenie-generator docs carpet-express.openapi-31.yaml \
carpet-express.asyncapi.yaml -o docs
$ cd docs && npm install && npm run buildWhat it covers
- Documentation sitesSeveral APIs of mixed standards in one static site, prerendered for search engines.
- Doc componentsA whole reference in one tag, or your own page from its parts.
- TranslationsExtract the texts, translate them, and publish each locale.
- ChangelogsThe changes of each API from its Git history, on its own page.
- Live previewThe editor renders the documentation as you edit.
- Five standardsOpenAPI, Swagger 2.0, AsyncAPI, GraphQL and Protobuf.
The tools that do it
Step by step
Publish API documentation: Build a documentation site from your API descriptions, translate it, add the changelog of each API, or put a reference into a page of your own.
A site to host, or elements for the page you have
Serve the site from any static host, or put <apg-api-reference> in a page of your own. Both read the files the linter checks.