Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apiParam with group set fails to create markdown #2

Open
Zambonilli opened this issue Apr 21, 2015 · 1 comment
Open

apiParam with group set fails to create markdown #2

Zambonilli opened this issue Apr 21, 2015 · 1 comment

Comments

@Zambonilli
Copy link

I'm failing to create the markdown from an api_data.json document that has an apiParam group value set. IE: @apiParam (URL) {String{1-64}} [foo=bar] foo bar

I've narrowed it down to the fact that the parameters iteration is hardcoded to the Parameter field that is the default name of the array if a group has not been set. I will update to iterate through the Object.keys() on the parameter obj and get a PR to you.

Error in the console:
throw err;
^
TypeError: ejs:23
21| <%-: data[group][sub][0].description | undef %>
22|

23| <%-: data[group][sub][0].type | upcase %> <%= data[group][sub][0].url %>
24|
25| <% if (data[group][sub][0].header && data[group][sub][0].header.fields.Header.length) { -%>
26| ### Headers

Cannot read property 'length' of undefined
at Object.keys.forEach.__stack.lineno (eval at (/usr/local/lib/node_modules/apidoc-markdown/node_modules/ejs/lib/ejs.js:237:14), :31:118)
at Array.forEach (native)
at eval (eval at (/usr/local/lib/node_modules/apidoc-markdown/node_modules/ejs/lib/ejs.js:237:14), :29:966)
at Array.forEach (native)
at eval (eval at (/usr/local/lib/node_modules/apidoc-markdown/node_modules/ejs/lib/ejs.js:237:14), :29:835)
at eval (eval at (/usr/local/lib/node_modules/apidoc-markdown/node_modules/ejs/lib/ejs.js:237:14), :41:21)
at /usr/local/lib/node_modules/apidoc-markdown/node_modules/ejs/lib/ejs.js:250:15
at Object. (/usr/local/lib/node_modules/apidoc-markdown/index.js:60:31)
at Module._compile (module.js:456:26)

@Zambonilli
Copy link
Author

It looks like this utility will have the same issue with some of the other parameter types as well. @apiHeader, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant