-
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
swag init: panic: recursively parsing struct #1662
Comments
As far as I can tell, there's no recursion in the openrtb.BidResponse struct, so it appears the parser thinks the local package and the imported package of the same name, is some sort of recursion. I did try aliasing the imported openrtb package in the local openrtb package. Also tried renaming the local openrtb pacakge and tried aliasing both packages throughout the code. None of that helped. |
Anybody? Would really appreciate a little help with this. |
Signed-off-by: sdghchj <sdghchj@qq.com>
@sdghchj just tested with your commit and my problem is resolved! Thank you! |
@sdghchj actually, think I spoke too soon. Now I'm getting this and no docs are being generated:
|
Can you please provide your simplified project? |
@sdghchj I just sent you an invite to a private repo that demonstrates the issue: https://github.com/jeffwalter-rum/swag-bug To reproduce:
|
I have tested on your repo, it'ok actually.
Check whether you have updated your swag to my latest commit, please. |
Ok, it works with the -pd flag. Might be good to provide a detailed example for the -pd flag in the README. I don't see it specifically called out there and would never have guessed that was the fix. Thanks for your help! |
Describe the bug
I have the following data strutures:
and the following package (github.com/my/local/openrtb):
I get the following panic:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A valid swagger file should be generated without a panic.
Your swag version
swag version v1.8.12
Your go version
go version go1.21.0 darwin/arm64
The text was updated successfully, but these errors were encountered: