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.

Build your API docsInstall API Genie

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.

Two pages of one site built from OpenAPI and AsyncAPI contracts: the REST operation Create a shipment on the left, the Kafka operation Publish shipment events on the right.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 build

What 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.

Other use cases