swagger-express-middleware
swagger-express-middleware copied to clipboard
Sample1 cannot run
410 returned
A few more details:
If you do the following:
git clone [email protected]:BigstickCarpet/swagger-express-middleware.git
cd swagger-express-middleware
npm install
cd samples
node sample1.js
You get a 410 response and the following in the logs:
swagger:middleware GET / does not exist, but the response schema defines a fallback value. So, using the fallback value +3ms
swagger:middleware Setting 0 response headers... +0ms
swagger:middleware Unable to find the file: "undefined". Sending an HTTP 410 (Gone) +1m
Error: / no longer exists
at ono (/swagger-express-middleware/node_modules/ono/lib/index.js:62:17)
at /swagger-express-middleware/lib/mock/index.js:301:12
at FSReqWrap.cb [as oncomplete] (fs.js:312:19)
On debugging, it looks as though sendFile in lib/mock/index.js is expecting the file parameter to be a Buffer object for the contents of index.html. file
is being passed as a raw string containing the contents of index.html, which sendFile tries to run fs.exists(file.path
on and subsequently falls over.
I guess there needs to be a route added to sendFile that allows file
to be passed as a raw string.
Thanks! @penx
Until May 15, I still cannot run node sample1.js
.... Is there any solution for this bug?
This issue still exists. Sample 2 also cannot be run