-
Notifications
You must be signed in to change notification settings - Fork 228
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
Improve Syntax Error reporting #282
Comments
Hi @lamuertepeluda thanks for the issue. Feel free to open a PR and implement this since you are fresh with the main idea of the issue. I will just ask you to add tests and prints on the final pr. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello and thank you very much for this tool!
I am using it but I found out that it is difficult to find the file that caused a syntax error.
Currently, a syntax error is reported like this:
No idea where this occurred, though! I was using a glob pattern like
src/api/**/index.js
where I have hundreds of folders with several API definitions per file... You can imagine my frustration!I had to use the debugger to find it out. Of course this is not the best-comfort solution for an information that is already available to the parser!
Proposed solution
Why don't you include the
filePath
into the error? The information is already available here https://github.com/Surnet/swagger-jsdoc/blob/master/src/specification.js#L182Just find a way to include it in the pushed errors https://github.com/Surnet/swagger-jsdoc/blob/master/src/specification.js#L198 and in the throwed errors https://github.com/Surnet/swagger-jsdoc/blob/master/src/specification.js#L264
Should I make a PR or do you prefer to handle this by yourself?
The text was updated successfully, but these errors were encountered: