-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 excluding file and placeholder file support #879
Comments
It looks like I can't make a pull request against this repo, so here's a patch working for me :) Maybe helpful for someone else ^
|
Another issue is that this doesn't work only directories, since the exclude list is checked only if f is directory.
|
Why not classify your endpoints into different directoies? |
I have ran into this issue too. It would be awesome to have either explicit "include" files or "exclude" work with files, not just directories. @sdghchj you can have the same code for an endpoint live in 1 directory, but want to expose different documentation for different consumers. Example would be internal API that should be complete, but external API where you have chosen to expose only a subset of necessary endpoints. I don't think its realistic for people to change directory structure simply to work around this tool. It may also be that it would break some other tool (like some code-gen, grpc, what have you). |
Is your feature request related to a problem? Please describe.
The project might include api endpoints for different ports. For example, one port for mobile, and one port for desktop. In this case,
pkg/user
might includepkg/user/api_mobile.go
andpkg/user/api_desktop.go
, and each file includes the port's own endpoints.The feature is to allow mobile version api doc to exclude all
api_desktop.go
file or*_desktop.go
.Describe the solution you'd like
Use command like
swag init --exclude api_desktop.go
orswag init --exclude *_desktop.go
to exclude filesapi_desktop.go
orendpoints_desktop.go
inside this project dir for doc generating.Describe alternatives you've considered
I was thinking the current option
--exclude
should achieve this already, but it is only excluding path now, but not specific file.Additional context
Maybe the final goal could be ignoring files like what
.gitignore
does for git repository ^?The text was updated successfully, but these errors were encountered: