-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
feat(packages): add option to filter generated endpoints #810
Conversation
Someone is attempting to deploy a commit to a Personal Account owned by @anymaniax on Vercel. @anymaniax first needs to authorize it. |
packages/core/src/types.ts
Outdated
@@ -51,6 +51,7 @@ export type NormalizedOutputOptions = { | |||
tsconfig?: Tsconfig; | |||
packageJson?: PackageJson; | |||
headers: boolean; | |||
filterTag?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about having this.
filters?: {
tags?: string[]
}
Like that we can add other filters like on the operation id.
What do you think about adding it in the input
section and not the output
one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with changing it to have a filters object, that would make more sense. I will be updating this asap.
About the input
section I'm not sure. I think it is more of a question how we see it:
- We only "read in" the relevant filtered elements.
- We only "output" the relevant filtered elements.
The first one would imply adding it in the input
section, the second one the output
section.
The main reason I chose to add it to the output section is since the function that I changed in the api.ts
file only receives NormalizedOutputOptions
as parameter. I could of course add the NormalizedInputOptions
as parameter to get the desired change, or do you think there would be a smarter way to go about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do the filter here and so we don't even read the operation. And in that case, you can also pass the NormalizedInputOptions
as a parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed it as you proposed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice works! Thanks for the pull request
In the case orval is run on a system with a lot of endpoints, it can be useful to limit which endpoints are actually generated.
In the case orval is run on a system with a lot of endpoints, it can be useful to limit which endpoints are actually generated.
Status
READY
Description
In the case orval is run on a system with a lot of endpoints,
it can be useful to limit which endpoints are actually generated.
See: #739
Todos
Steps to Test or Reproduce
Outline the steps to test or reproduce the PR here.