You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When there are 2 "child" structs that embed the same struct S1, and S1 also has a pointer to one of the child structs, swag init is unable to parse it and errors out.
To Reproduce
Steps to reproduce the behavior:
Create a new go file with the following MVE using the gin framework:
Expected behavior
The swag init should generate docs normally using definition references as it already does for normal cyclic references
Screenshots
N/A
Your swag version
1.16.4
Your go version
1.23.3
Desktop (please complete the following information):
OS: macOS
Browser: Chrome 131.0.6778.109
Version: Sonoma 14.7.1
Additional context
This example has been boiled down for simplicity, but we do have places in the actual Golang model we use in our company where 2 child structs embed the same parent struct, yet the parent struct has a pointer to one of the child structs as well. (It's not great, but we cannot get rid of it since it would break our existing production environment)
The text was updated successfully, but these errors were encountered:
Describe the bug
When there are 2 "child" structs that embed the same struct S1, and S1 also has a pointer to one of the child structs, swag init is unable to parse it and errors out.
To Reproduce
Steps to reproduce the behavior:
main.go
The go.mod file can be generated as:
swag init
go run main.go
curl 'http://localhost:8080/ping'
Expected behavior
The swag init should generate docs normally using definition references as it already does for normal cyclic references
Screenshots
N/A
Your swag version
1.16.4
Your go version
1.23.3
Desktop (please complete the following information):
Additional context
This example has been boiled down for simplicity, but we do have places in the actual Golang model we use in our company where 2 child structs embed the same parent struct, yet the parent struct has a pointer to one of the child structs as well. (It's not great, but we cannot get rid of it since it would break our existing production environment)
The text was updated successfully, but these errors were encountered: