Getting Started
An example hand-written guide, to show that ordinary MDX authoring is unchanged by the OpenAPI setup.
Install
npm install
Run the dev server
npm start
Refresh the API reference
The pages under /api are build artifacts derived from the DNA backend's
OpenAPI schema. Refreshing them is two steps — pull the schema from upstream,
then regenerate the MDX:
./scripts/fetch-openapi.sh # openapi/backend.json
npm run regen-api-docs # api/reference/
fetch-openapi.sh copies the backend's committed backend/docs/openapi.json
from the sibling checkout (regenerate that first with make openapi in
backend/ if you changed routes or models). Both the source file and the
base URL recorded for the API demo panel can be overridden:
DNA_SPEC=/path/to/openapi.json ./scripts/fetch-openapi.sh
DNA_SERVER_URL=https://dna.example.com ./scripts/fetch-openapi.sh
To remove the generated MDX without regenerating:
npm run clean-api-docs
npm run build does not refresh the spec or regenerate API docs on its
own. Run the two steps above first, or use npm run build:full, which chains
fetch, regenerate and build.