RESTful web API & MQTT Protocol Documentation Generator - A modern TypeScript fork of the original apidoc project with active maintenance, modern tooling, and comprehensive MQTT support.
APIDoc generates comprehensive documentation for RESTful APIs and MQTT protocols from source code comments. Compatible with C#, Go, Dart, Java, JavaScript, PHP, TypeScript, Python, Ruby and more.
/**
* @api {get} /user/:id Request User information
* @apiName GetUser
* @apiGroup User
*
* @apiParam {Number} id Users unique ID.
*
* @apiSuccess {String} firstname Firstname of the User.
* @apiSuccess {String} lastname Lastname of the User.
*/
# Global installation
npm install -g @hrefcl/apidoc
# Generate documentation
apidoc -i src/ -o docs/
# View documentation
open docs/index.html
Add custom markdown content to any API group with rich formatting:
{
"settings": {
"Users": {
"icon": "fa-user",
"title": "User Management",
"filename": "user.md"
}
}
}
Document MQTT protocols with 16 specialized tags:
/**
* @mqtt {publish} v1/sensors/{id}/data Publish Sensor Data
* @mqttGroup IoT
* @topic v1/sensors/{id}/data
* @qos 1
* @retain false
*/
Protect your documentation with local and remote authentication:
{
"login": {
"active": true,
"admited": [{"email": "admin@company.com", "password": "secure123"}],
"urlAuth": "https://api.company.com/auth/login"
}
}
Write OpenAPI specifications directly in comments:
/**
* @openapi
* /api/users/{id}:
* get:
* summary: Get user by ID
* parameters:
* - name: id
* in: path
* required: true
* schema:
* type: integer
*/
Generate documentation from TypeScript interfaces:
/**
* @api {get} /users/:id Get User
* @apiSuccess {Object} user User data
* @apiSchema {User} user
* @apiSchemaFile ../types/user.ts
*/
MIT License - see LICENSE file for details.
Made with β€οΈ by the APIDoc community. Originally created by Peter Rottmann.