Shortcut:/key

API reference - Introduction

Last updatedJuly 15, 2021

API reference is a manual containing all the information required to work with the API, with details about functions, classes, return types, arguments and more.

Developers will often use the docs to quickly get started with your API and will turn to the API reference when they need to look up a in-depth information. API reference is key to a great DX

Hoss supports OpenAPI v2 (Swagger) and v3 and comes with

  • Code samples are automatically generated for more than 20 languages & libraries
  • Support custom code samples
  • Embedded API explorer that let developer tries API without leaving the reference

Install

Install API reference plugin

yarn add @hoss/plugin-content-api-reference

Then, add it in your site's hoss.config.js

module.exports = {
  // ...
  plugins: ['@hoss/plugin-content-api-reference'],
};

Finally, add your OpenAPI specification file to ROOT/api-reference/.

website # root directory of your site
├── api-reference
│   └── openapi.yml
├── src
│   └── pages

Hoss also support json format

The reference will be available at http://localhost:3000/api-reference