在文档注释中使用@apiParam标签,并在其后面添加“{必填}”或“{required}”,以明确参数是否为必填项。例如:
/**
* @api {post} /user/add 添加用户
* @apiName addUser
* @apiGroup User
*
* @apiParam {String} name 用户名{必填}
* @apiParam {String} email 邮箱{required}
*
* @apiSuccess {String} message 操作结果信息
*/
这样生成的文档就能清晰的显示每个参数是否为必填项。