Closed MatthewDownsNR closed 2 years ago
Figured it out, I had a rogue JSDoc somewhere in my code that has "@openapi", but with nothing else. This was sending a value of null
to this function in the yaml
library.
The suggestion then would be to throw a more meaningful error message when the JSDoc is empty.
+1 for a more helpful error in this scenario.
Describe the bug Attempting to generate the OpenAPI in a TypeScript project is causing the error described in the title. It appears to be coming from the
yaml
library. So the likely scenario is that my JSDoc YAML is invalid, right? Interestingly, it still gives the error when I use the basic example on this repo from here.To Reproduce Steps to reproduce the behavior:
Setup a very basic typescript express application:
Expected behavior The JSDoc OpenAPI YAML spec should be parsed correctly
Desktop (please complete the following information):
Additional context
As a last ditch effort, I cloned this repository and tried running the app example, and got the expected output. It doesn't make sense to me why it wouldn't be parsing the YAML correctly just because the source files are in TypeScript, since in my provided code example, I'm checking the compiled .js files. I also made sure comments are being emitted to the compiled code, and they are. Anyone know what could be causing the TypeError?