docs-v2/api-docs/README.md

38 lines
1.0 KiB
Markdown
Raw Normal View History

2019-09-27 20:42:01 +00:00
## Generate InfluxDB API docs
2019-09-30 16:16:09 +00:00
InfluxDB uses [Redoc](https://github.com/Redocly/redoc/) and
[redoc-cli](https://github.com/Redocly/redoc/blob/master/cli/README.md) to generate
API documentation from the InfluxDB `swagger.yml`.
2019-09-27 20:42:01 +00:00
2019-09-30 16:16:09 +00:00
To minimize repo size, the generated API documentation HTML is gitignored, therefore
not committed directly to the docs repo.
The InfluxDB docs deployment process uses swagger files in the `api-docs` directory
to generate version-specific API documentation.
2019-09-27 20:42:01 +00:00
2019-09-30 16:16:09 +00:00
### Versioned swagger files
Structure versions swagger files using the following pattern:
2019-09-30 16:59:25 +00:00
2019-09-27 20:42:01 +00:00
```
2019-09-30 16:16:09 +00:00
api-docs/
├── v2.0/
│ └── swagger.yml
├── v2.1/
│ └── swagger.yml
├── v2.2/
│ └── swagger.yml
└── etc...
```
### Generate API docs locally
Because the API documentation HTML is gitignored, you must manually generate it
to view the API docs locally.
From the root of the docs repo, run:
```sh
# Install redoc-cli
2019-09-27 20:42:01 +00:00
npm install -g redoc-cli
2019-09-30 16:16:09 +00:00
# Generate the API docs
cd api-docs && generate-api-docs.sh
2019-09-27 20:42:01 +00:00
```