Open datdinhquoc opened 5 years ago
I'am got this error too
i've tried to replace dependency of fs-extra with latest and error gone but result swagger.json became corrupt.
I've attempted before to update dependencies with recent versions, it was more work than expected, I need to find a time to fix it, if anyone could help will be nice.
I can try to help with it. Any pointers for getting started?
@fsbahman Fixed this issue, can you please take a look at the PR https://github.com/fsbahman/apidoc-swagger/pull/49
Thanks @kalramanoj2002 I will have a look.
New version v0.3.1 is released thanks to @kalramanoj2002, please check it out if issues are solved.
have 1 error with 0.3.1: using old stable config (apidoc.json in root of project):
{
"_comment": "REST API version",
"version": "1.0.0",
"sampleUrl": false,
"title": "REST documentation",
"header": {
"title": "",
"filename": "src/apidoc/header.md"
},
"footer": {
"title": "",
"filename": "src/apidoc/footer.md"
}
}
Using this command in root of project:
npx apidoc-swagger -i src/rest/ -o built/public/doc-rest
Getting this error:
error: Can not read: src/apidoc/header.md.
Tried to use absulute path to file with no success. File exists and apidoc itself sees and uses it.
@fsbahman @rusekr Fixed the header/footer issue. Can you please take a look https://github.com/fsbahman/apidoc-swagger/pull/51
@fsbahman @rusekr Fixed the header/footer issue. Can you please take a look
51
Tested. Now error about header gone, but got new error:
# npx apidoc-swagger -i src/rest/ -o built/public/doc-rest
error: Empty parser result.
{
File: 'src/rest/project.js',
Block: 1,
Element: '@apiDescription',
Source: '@apiDescription '
}
Where in project.js
apiDescription is just empty:
/**
* @apiVersion 1.0.0
* @apiPermission project.settings.get
* @api {get} /project/settings Get project settings list
* @apiDescription
* @apiName GetProjectSettings
* @apiGroup ProjectSettings
Filled description and now it generates file without errors. Thanks!
@rusekr @fsbahman is apiDescription an optional field? do we needs to handle the above scenario i.e. it should not throw error if apiDescription is empty or not provided?
I will spend some time later this week to see what is wrong, maybe PR from @rusekr is good enough, I have to extent the unit test to find this issues as well. Also after upgrading some of the dependencies in this PR build is failing on CircleCi, look like some of the packages are not Linux compatible.
Vote for 0.3.2 patch with patched headers. It can be used now with node 12 at all. Error with description is very minor for me. :)
Ok so for now I will just merge it and release new version. Thanks!
Done! v0.3.2
apidoc-swagger doesn't run on Node.js 12 any more, it complains something about 'primordials':