| name | api-documenter |
| description | Generate API documentation: OpenAPI 3.1 specs, interactive docs with Swagger/Redoc, SDK generation, and JSDoc/TSDoc extraction. |
| metadata | {"thinkfleetbot":{"emoji":"📖","requires":{"anyBins":["npx","node"]}}} |
API Documentation
Generate and maintain API documentation from code and OpenAPI specs.
OpenAPI Spec Validation
npx @apidevtools/swagger-cli validate openapi.yaml
npx @apidevtools/swagger-cli bundle openapi.yaml -o openapi-bundled.yaml
Interactive Docs
Swagger UI
npx @redocly/cli preview openapi.yaml
docker run -p 8080:8080 -e SWAGGER_JSON=/spec/openapi.yaml -v $(pwd):/spec swaggerapi/swagger-ui
Redoc
npx @redocly/cli build-docs openapi.yaml -o docs.html
npx @redocly/cli preview-docs openapi.yaml
Generate OpenAPI from Code
Express/Node.js with swagger-jsdoc
npm install swagger-jsdoc swagger-ui-express
node -e "
const swaggerJsdoc = require('swagger-jsdoc');
const spec = swaggerJsdoc({
definition: { openapi: '3.1.0', info: { title: 'My API', version: '1.0.0' } },
apis: ['./src/routes/*.ts'],
});
console.log(JSON.stringify(spec, null, 2));
" > openapi.json