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

Circular referrenced structs(trees) produces string instead of object #1713

Open
taalhach opened this issue Dec 4, 2023 · 0 comments
Open

Comments

@taalhach
Copy link

taalhach commented Dec 4, 2023

Describe the bug
We have a tree node struct as soon as we generate docs children is composed as string whereas we are expecting an object. We have tried making separate children struct but after 1 level it also i can still see Children as string instead of object

type Node struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Children []Node `json:"children"`
}

Expected behavior

{
  "children": [
    {
      "id": 0,
        "name": "string",
        "children": null || embeded struct
    }
  ],
  "id": 0,
  "name": "string"
}

Screenshots
image
Your swag version
v1.16.2

Your go version
go1.21.3

Desktop (please complete the following information):

  • OS: macos
  • Browser: brave

Additional context
Add any other context about the problem here.

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

1 participant