You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
YAMLSemanticError: Nested mappings are not allowed in compact mappings at line 23, column 25:
type: string
^^^^^^…
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!
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.
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: