Document your API in a simple way.
Create a user.json
file in the folder /api/
with the following structure
{
"title":"User info",
"description":"Etiam vel...",
"method":"post",
"path":"/api/v1/user/{id}",
"path_info":"Curabitur...",
"parameters":[
["{id}","4553356","Nulla nu..."],
["authorization","auth123token","Lorem..."],
["email","[email protected]","Integer nec..."],
["active","true|false","Maecenas..."]
],
"header":{
"authorization": "auth123token"
},
"body":{
"email":"[email protected]",
"active":true
},
"response":{
"success": true,
"user": {
"name":"Albert",
"email":"[email protected]",
"phone":"+51 1 568833002",
"age":23,
"city":"New York"
}
}
}
Run the command
npm run build
And open the folder docs
, the user.html
will be created.
Here is an example
The genered result is pure html files, just open it on browser or public it on S3 for your team.
Feel free to collaborate with this project.
on twitter @rollrodrig