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

Nested Generic Fields #1304

Closed
johan-lejdung opened this issue Aug 23, 2022 · 3 comments
Closed

Nested Generic Fields #1304

johan-lejdung opened this issue Aug 23, 2022 · 3 comments

Comments

@johan-lejdung
Copy link

johan-lejdung commented Aug 23, 2022

Describe the bug
Nested Generic fields still not supported even after #1277 and #1281 on certain occasions.

To Reproduce
Have a look at the following repo https://github.com/chaintraced/swaggo-issue-repo
On the main branch you will see that it is not working as intended, whilst on the branch functional-branch it's working beautifully.

The only difference being that the nested generic field is in another package on the main branch, very interesting behaviour.

Expected behaviour
I expect the generic field to be properly read and generated

Your swag version
I forked the repo to be able to release a version including the latest generic code changes https://github.com/chaintraced/swag

Your go version
e.g. 1.18.0

@johan-lejdung
Copy link
Author

@FabianMartin sorry to tag you again. Just thought that this could potentially be interesting for you to know about. Your merged code works beautifully out of the box, but not when the generic field declaration is in another package. The linked repo above should demonstrate the issue well.

FabianMartin added a commit to FabianMartin/swag that referenced this issue Aug 23, 2022
… another package

- change full name generation and support SelectorExpr
- prepend package only, if no name does not contain package

fixes swaggo#1304
@FabianMartin
Copy link
Contributor

Hi @johan-lejdung

Thank you for the test repo. You find the fix in PR #1305

@johan-lejdung
Copy link
Author

Much appreciated @FabianMartin, your contributions means a lot 🙏

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