Open antonov-abto opened 6 years ago
Hi @antonov-abto, I'll need to update the README.
I had to use the .get()
API to make it work. See my test file for an example. That was one of the differences between Express and Restify.
Oh and sorry for the late reply.
@bvanderlaan @antonov-abto after changing the .use to .get I get the following, see attachment.
I confirmed my swagger.json file is in the right directory. Any advice would be appreciated!
Thanks,
Corey
I am getting same Error
@bvanderlaan in your test file you have a wrong route for static files, try change to
app.get(/\/swagger-ui+.*/, ...swaggerUi.serveFiles(swaggerSpec))
app.get('/swagger', swaggerUi.setup(swaggerSpec));
P.S.: i use swagger-jsdoc
worked for me:
server.get('/api/:whatever', swaggerUi.serveFiles(swaggerDocument));
server.get('/api/', swaggerUi.setup(swaggerDocument));
The documentation for this repo is out-of-date. See this comment for help: https://github.com/bvanderlaan/swagger-ui-restify/issues/3#issuecomment-621388734
hello. when I try to write: app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec)); I get a message: throw new assert.AssertionError({ ^
AssertionError [ERR_ASSERTION]: handler (func) is required at new AssertionError (internal/errors.js:315:11)