Surnet/swagger-jsdoc

Separate annotation to different files

Tamir198 opened this issue · 1 comments

Given this example from the docs:

/**
 * @openapi
 * /:
 *   get:
 *     description: Welcome to swagger-jsdoc!
 *     responses:
 *       200:
 *         description: Returns a mysterious string.
 */
app.get('/', (req, res) => {
  res.send('Hello World!');
});

Is it possible to separate all the annotations into a different file?
I have checked the docs and issues opened but could not find anything.

AM i missing someplace in the documentation talking about this?

By the way I am using swagger-jsdoc version 6.2.5

Ok all you need to do is to create new js file and put your annotations there.