Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] the generic filesPattern: './**/*.js' don't work #184

Closed
neo4010 opened this issue Sep 6, 2021 · 1 comment · Fixed by #185
Closed

[BUG] the generic filesPattern: './**/*.js' don't work #184

neo4010 opened this issue Sep 6, 2021 · 1 comment · Fixed by #185
Labels
bug Something isn't working

Comments

@neo4010
Copy link

neo4010 commented Sep 6, 2021

Describe the bug
As specified in the doc, I would like to be able to use a generic filesPattern. Using filesPattern: './**/*.js', it's not work. However, if I specify the "./app.js" file, the route is well documented.

To Reproduce
My app.js:

const express = require('express');
const expressJSDocSwagger = require('express-jsdoc-swagger');

const options = {
  info: {
    version: '1.0.0',
    title: 'Albums store',
    license: {
      name: 'MIT'
    }
  },
  security: {
    BasicAuth: {
      type: 'http',
      scheme: 'basic'
    }
  },
  baseDir: __dirname,
  filesPattern: './**/*.js',
  swaggerUIPath: '/api-docs',
  exposeSwaggerUI: true,
  exposeApiDocs: true,
  apiDocsPath: '/v3/api-docs',
  notRequiredAsNullable: false,
  swaggerUiOptions: {},
};

const app = express();
const PORT = 3000;

expressJSDocSwagger(app)(options);

/**
 * GET /api/v1
 * @tags Book
 * @summary This is the summary of the endpoint
 * @return {object} 200 - success response
 */
app.get('/api/v1', (req, res) => res.json({
  success: true,
}));

app.listen(PORT, () => console.log('Example app listening at http://localhost:${PORT}'));

Screenshots
With filesPattern: './**/*.js'
image

With filesPattern: './app.js'
image

Desktop (please complete the following information):

  • OS: Windows
  • Version 10
@kevinccbsg kevinccbsg added the bug Something isn't working label Sep 6, 2021
@kevinccbsg
Copy link
Member

You're right there's a bug in the Regexp. We will release a patch for this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants