Open Uter1007 opened 8 years ago
@Uter1007 try to use the excluding filters and remove the node_modules/ folder.
Have the exact same problem.
apidoc-swagger -o/docs warn: parser plugin 'param' not found in block: 1 error: Cannot read property 'indexOf' of undefined
Folderstructure:
Any idea how to resolve this?
@svanbelleghem @Uter1007 Here try this:
apidoc-swagger -v -e "node_modules/" -f \'.*\\.js$\' -i ./api -o ./
Btw: thanks for the reply ;)
apidoc-swagger -v -e "node_modules/" -f \'.*\\.js$\' -i ./api -o ./
verbose: apidoc-generator name: apidoc-swagger
verbose: apidoc-generator version: 0.2.2
verbose: apidoc-core version: 0.3.1
verbose: apidoc-spec version: 0.2.0
verbose: run parser
error: No files found.
{ Path: '.' }
@svanbelleghem replace the js
extension to which you are currently working with.
apidoc-swagger -v -e "node_modules/" -f \'.*\\.<replace me>$\' -i ./api -o ./
replace the js extension to which you are currently working with.
Do you mean the apidoc configfile which is written in json?
What are the files that contain the documentation block on it? On the image that you attached I couldn't see any well-known structure for a project, so I need to know in order to help you out.
vendor
and apidoc
doesn't mean nothing.
vendor
is my composer output folder. apidoc
is the output folder from a previous generated apidoc. Index.php contains the code that needs to be documented.
@svanbelleghem ok, try this then apidoc-swagger -v -e "node_modules/" -f \'.*\\.php$\' -i ./vendor/index.php -o ./
Index.php is located on the root, not in vendor (excuses for the misunderstanding). But when I try apidoc-swagger -v -e "node_modules/" -f \'.*\\.php$\' -i ./index.php -o ./
I still got the same result:
apidoc-swagger -v -e "node_modules/" -f \'.*\\.php$\' -i ./index.php -o ./
verbose: apidoc-generator name: apidoc-swagger verbose: apidoc-generator version: 0.2.2 verbose: apidoc-core version: 0.3.1 verbose: apidoc-spec version: 0.2.0 verbose: run parser error: No files found. { Path: '.' }
Ok, then try cd /html/ && apidoc-swagger -v -e "node_modules/" -f \'.*\\.php$\' -i ./ -o ./
If you still getting the same error, it means that it is not finding the index.php
.
I'm really sorry but still getting the same error. But with cmd I can locate the file.
if exist index.php echo File Found!
File Found!
And when I run apidoc alone it runs smoothly. Do I need to specify some settings in apidoc.json or in my index.php besides the standart apidoc settings and annotations?
Ok, so for some reason this apidoc-swagger -i example/ -o doc/
works perfectly!
@svanbelleghem apidoc-swagger -i example/ -o doc/
, what files does the 'example' directory contain?
Same problem when run apidoc-swagger
Got these output
error: Cannot read property 'indexOf' of undefined
debug: TypeError: Cannot read property 'indexOf' of undefined
at createFieldArrayDefinitions (/usr/local/lib/node_modules/apidoc-swagger/lib/apidocToSwagger.js:188:25)
at createVerbDefinitions (/usr/local/lib/node_modules/apidoc-swagger/lib/apidocToSwagger.js:134:22)
at createGetDeleteOutput (/usr/local/lib/node_modules/apidoc-swagger/lib/apidocToSwagger.js:236:29)
at extractPaths (/usr/local/lib/node_modules/apidoc-swagger/lib/apidocToSwagger.js:64:19)
at Object.toSwagger (/usr/local/lib/node_modules/apidoc-swagger/lib/apidocToSwagger.js:13:18)
at Object.createApidocSwagger (/usr/local/lib/node_modules/apidoc-swagger/lib/index.js:107:63)
at Object.
Any update?
still got the same error
Same
Open file apidocToSwagger.js
row 274
replace if (verbs.parameter && verbs.parameter.fields.Parameter)
to
if (verbs.parameter && verbs.parameter && verbs.parameter.fields && verbs.parameter.fields.Parameter)
see PR #57
I know why throw this error now~ Look at the photos.
var type = parameter.type;
This variant need to get the type, and this type from {}. But code lack the {}
@apiParam {string} userId 用户
@18819296186, you are right. In order to solve this problem:
Open file apidocToSwagger.js on row 190
replace
var typeIndex = type.indexOf("[]");
to
var typeIndex = type === undefined ? -1 : type.indexOf("[]");
apidoc on it's own runs smoothly.
apidoc-swagger -i dist/ -o doc/ (node:10252) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. warn: parser plugin 'param' not found in block: 0 error: Cannot read property 'indexOf' of undefined