Apidocjs document creation issue, warning : plugin param parser not found and missing comma issue

7.1k views Asked by At

I tried to create API documentation using apidocjs and i got issues while compiling project for creating apidoc using apidoc.json on project folder.

Code here :

~$ apidoc -i ./ -o apidoc/

And result

warning: parser plugin 'param' not found.
error:   Error: Can not read: apidoc.json, please check the format (e.g. missing comma).

Please anyone help me to fix this issue

Tags related to apidocjs.com

6

There are 6 answers

1
codersaif On
~$  apidoc -i ./ -e apidoc/ -o apidoc/

when api document generates, it generates main.js file with @param. and as that @param will also be checked next time of generation, you can just skip that output directory and all are good to go.

0
Strabek On

I had the same proble. I'm using custom template and template folder was in the same location as my *.js files which are parsed including main.js template file. -e option did not worked for me so I moved template folder to other location and everything works fine.

0
xxnull On

I had the same issue in rebar using erlang and what I did was in the project root folder:

rm -rf doc/

then I run again apidoc

info: Done

1
Phil Ives -Rain Everywhere On

Removing the apidoc destination folder as @Prasanth suggests will destroy your history if you are using the @apiVersion feature. The only way you could rebuild it is to go through and checkout each version, then run the apidoc. So, if you want to use versioning. This is not your answer.

You may have syntax issues or some other configuration issue. In my case, since updating I had some functions documented in javadoc style with @param... this used to be ignored but now throws the warning.

1
AudioBubble On

Issue is fixed for me as well, This error comes from the generated docs/main.js. Usually we should parse only necessary files, to generate this apiDoc.

I used -f .php in my command, like apidoc -f .php -i ./ -o ./. This is working like a miracle.

0
KiberInfinity On

For fix this bug, you can try to save package.json and apidoc.json without UTF-BOM symbol. Some versions, parts or dependecies of apidoc use code similar with this

JSON.parse(fs.readFileSync(file, 'utf-8')) // throw "Uncaught SyntaxError: Unexpected token  in JSON at position 0"