当我尝试更新时,Apidocjs会发出警告

时间:2015-06-08 20:15:03

标签: api-doc

好的,所以我正在玩apidocjs来解决它,然后在生产环境中实现它并且正在遇到以下情况:

~/apidoc_playground$ apidoc
warn: parser plugin 'param' not found in block: 0
info: Done.

以下是它正在查看的块注释(每个都在一个单独的文件中):

/**
*this is a test of apidocjs
*@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.
*
*/

/**
 *@api {GET} /getPicture/:UID Retreive user profile picture
 *@apiGroup User
 *@apiName getPicture
 *@apiVersion 0.0.1
 *
 *@apiDescription userID goes in, picture comes out, you can't explain that!
 *@apiParam {int} UID User's identification number.  
 *@apiExample {curl} Example usage:
 *      curl -i http://api.example.com/getPicture/45123
 *@apiSuccess (200) {json} picture The user's profile picture
 *@apiError (4xx) {userNotFound} UID There was no user affiliated with the given id.
 *@apiErrorExample {json} Error-Response:
 *      HTTP/1.1 404 Not Found
 *      {
 *              "error":"UserNotFound"
 *      }
 */

我所知道的:

这不会导致更新失败,apidoc会按预期更新输出目录。

如果我在调用apidoc之前删除了输出目录,则没有警告。

如果没有要解析的文件,警告仍然会出现。

在搜索答案后,我能找到的最多是question,与我的相似,只是提问者在他的apidoc.json中也有格式错误。话虽这么说,该线程中的答案并没有真正满足我正在寻找的东西(一个是在调用apidoc之前删除输出文件夹,另一个是如果你想保留历史记录而不是删除输出文件夹你有格式错误。)

来自更有经验的apidocjs用户的任何见解都会受到关注。

对不起文字墙

1 个答案:

答案 0 :(得分:0)

如果即使输入和输出目录都为空也会发生这种情况,这表明安装可能有问题。

尝试擦除并重新添加。

npm remove -g apidoc
npm install -g apidoc