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

Proper way to ignore or exclude specific files from apis #365

Open
IamGideonIdoko opened this issue Jun 13, 2023 · 2 comments
Open

Proper way to ignore or exclude specific files from apis #365

IamGideonIdoko opened this issue Jun 13, 2023 · 2 comments
Labels
pinned Issues that will not be automatically closed

Comments

@IamGideonIdoko
Copy link

Is your feature request related to a problem? Please describe.
It's a feature request. I understand that swagger-jsdoc uses node-glob for discovering input files based on given patterns but I should be able to specify files that I want to ignore from a pattern. Maybe by providing another option like ignoreApis or honoring negative patterns (!).

Describe the solution you'd like
If I have a pattern for getting input files like this:

const option = {
  apis: ['./src/routes/*.ts'],
};

I should be able to ignore or exclude a specific file that the pattern also matches like this:

const option = {
  apis: ['./src/routes/*.ts', '!./src/routes/auth.route.ts'],
};

Describe alternatives you've considered
OR like this:

const option = {
  apis: ['./src/routes/*.ts'],
  ignoreApis: ['./src/routes/auth.route.ts']
};

Additional context
This is useful in a case like mine where I wan to exclude some routes from being documented on the prod server

@daniloab
Copy link
Collaborator

Hi, here I have an example of how to build your files dynamically. You can have try to use it to build the specific routes that you want to https://github.com/daniloab/koa-crud-backend/blob/main/script/generateSwagger.ts

@stale
Copy link

stale bot commented Aug 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 18, 2023
@daniloab daniloab added pinned Issues that will not be automatically closed and removed wontfix labels Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned Issues that will not be automatically closed
Projects
None yet
Development

No branches or pull requests

2 participants