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

my functions are in other directory and swagger can't detect them #104

Open
seyedmo30 opened this issue May 15, 2023 · 1 comment
Open

Comments

@seyedmo30
Copy link

No description provided.

@jsperandio
Copy link

jsperandio commented Jan 26, 2025

I solved it usingswag initin the directory above the other packages and ref main.go with -g.
It seems it goes recursively through the folders, picking up everything, then just changing the output of the docs to the desired location with -o option.

example :

swag init -g cmd/updater/main.go -o cmd/updater/docs/

cmd/
├── updater
│   ├── main.go
│   ├── docs
│   │   ├── docs.go
│   │   └── ....
internal/
├── server
│   │   └── handler
│   │       ├── health.go
│ ...

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