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

Bypass errors or completely skip package analysis/parsing #1867

Open
maitredede opened this issue Aug 10, 2024 · 1 comment
Open

Bypass errors or completely skip package analysis/parsing #1867

maitredede opened this issue Aug 10, 2024 · 1 comment

Comments

@maitredede
Copy link
Contributor

Hello

Describe the bug

I use https://github.com/MarcoWel/gozxing in my code, but its code has invalid argument params : authors used @param comment syntax for methods, also used by swaggo. And swaggo tries to parse it.

// getCharacter Gets the character (or string) corresponding to the passed code in the given table
//
// @param table the table used
// @param code the code of the character
func getCharacter(table Table, code int) (string, error)
ParseComment error in file /home/memyselfandi/go/pkg/mod/github.com/!marco!wel/[email protected]/aztec/decoder/decoder.go :missing required param comment parameters "table the table used"

To Reproduce
Steps to reproduce the behavior:

  1. Create a project that uses github.com/MarcoWel/gozxing
  2. swag init --parseDependency --parseDependencyLevel=2

Expected behavior
Since the error is legit, I would like to skip this error, or totally skip the gozxing library.

I tried using .swaggo to skip library, and also some variants of the --exclude argument.

Screenshots
N/A

Your swag version
swag version v1.16.2

Your go version
go version go1.22.6 linux/amd64

Desktop (please complete the following information):

  • OS: debian bookworm amd64
  • Browser: N/A
  • Version: N/A

Additional context
Add any other context about the problem here.

@ubogdan
Copy link
Contributor

ubogdan commented Oct 19, 2024

This issue comes from the fact you are importing the library in your handlers. Try to define an interface and to provide the implementation at runtime so swag won't try to parse it. 💡

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