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

swag does not generate spec for struct fields defined in comma separated syntax #1871

Open
that-ambuj opened this issue Aug 18, 2024 · 1 comment

Comments

@that-ambuj
Copy link

Describe the bug
When fields of a struct that have the same type are defined as comma separated,
swag ignores the fields except the first one.

To Reproduce

  1. Define a Go struct with the following syntax
    type Point struct {
      SRID int
      X, Y float64 // Notice these are on the same line and this is a valid syntax
    }
  2. Generate the spec for this struct.
  3. Get a struct that has the Y field missing.
    image

Expected behavior
Expected the generated swagger model/schema to have the missing y field

Screenshots
If applicable, add screenshots to help explain your problem.

Your swag version
1.16.3

Your go version
1.22.5

Desktop (please complete the following information):

  • OS: Debian 12 in WSL
  • Browser: Firefox
  • Version: N/A

Additional context
The type I'm using is imported from another package, so I can't really fix the type definition in Go without making a huge PR.

@that-ambuj that-ambuj changed the title swag does not generate spec for struct defined in as comma separated swag does not generate spec for struct fields defined in comma separated syntax Aug 18, 2024
@ubogdan
Copy link
Contributor

ubogdan commented Oct 19, 2024

@that-ambuj Please try with 1.16.4 and let us know.

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