Skip to content

Doc generation : fix issue with anonymous access function #11

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/utils/docGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function _param(file, type, keyBase, location) {
fs.appendFileSync(file, ` * @apiParam {${sType}} ${sKeyD} ${formatedLocation}${description}\n`);
if (tmpType instanceof TypeObject) {
_param(file, tmpType, sKey, location);
}}
}
}
}
} else if (type instanceof TypeArray) {
const sType = capitalize(type._type || 'Any');
Expand Down Expand Up @@ -79,7 +80,7 @@ export function generateDoc(classRoute, route) {
const apiPermission = options.accesses.map(e => e.name || e).join(' OR ');
fs.appendFileSync(file, ` * @apiPermission ${apiPermission}\n`);
} else if (Array.isArray(classRoute.accesses) && classRoute.accesses.length) {
const apiPermission = classRoute.accesses.map(e => e.name).join(' ');
const apiPermission = classRoute.accesses.map(e => e.name || e).join(' OR ');
fs.appendFileSync(file, ` * @apiPermission ${apiPermission}\n`);
} else {
fs.appendFileSync(file, ' * @apiPermission public\n');
Expand Down Expand Up @@ -115,7 +116,7 @@ export function end() {
cmdApidoc.on('close', code => {
if (code === 1) {
// eslint-disable-next-line
console.error('[DocGenerator] an error when generate the apiDoc ');
console.error('[DocGenerator] an error occured when generating the apiDoc');
}
spawn(_getCmd('rm'), cmdArgsRm);
});
Expand Down