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

Add "exclude" option as a supplement to "include" #1288

Closed
evantrimboli opened this issue Apr 6, 2021 · 3 comments
Closed

Add "exclude" option as a supplement to "include" #1288

evantrimboli opened this issue Apr 6, 2021 · 3 comments

Comments

@evantrimboli
Copy link

evantrimboli commented Apr 6, 2021

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Currently, a swagger document gives you the option for which modules to include. This is very useful.

Expected behavior

It would be useful to provide the opposite of this, where a set of modules could be excluded.

Minimal reproduction of the problem with instructions

N/A

What is the motivation / use case for changing the behavior?

Let's say I'm developing an API that could be reasonably separated into two parts, client A will only call into section 1, client B will only call into section 2. If I want to generate an API document, I can do something like this:

const section1Modules = [foo, bar, baz];
const opts = {
  include: process.ENV.section1 ? section1Modules : undefined,
  exclude: process.ENV.section2 ? section1Modules: undefined
};

Without this, I would need to maintain two sets of modules, as opposed to just a single one here. Thanks for your consideration.

Environment


Nest version:4.7.16
 
For Tooling issues:
N/A

Others:
N/A
@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@evantrimboli
Copy link
Author

Yeah, I've had a brief look at the code and it seems like it would be relatively simple.

@kamilmysliwiec
Copy link
Member

Let's track this here #1289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants