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

Array of Maps causes parsing errors in nested description Items->Types #584

Closed
NamelessHH opened this issue Dec 16, 2019 · 2 comments
Closed

Comments

@NamelessHH
Copy link

NamelessHH commented Dec 16, 2019

Describe the bug
\u0026{%!s(token.Pos=222) string %!s(*ast.InterfaceType=\u0026{233 0xc00039a300 false})}

shows as the description to an array type of map.

To Reproduce
Steps to reproduce the behavior:

  1. create a datatype
type DataDto struct { 
	Data           []map[string]interface{} `json:"data"` //The Individual Records
	Count          int                      `json:"count"`
	Average   float64                  `json:"averageScore,string"`
}
  1. set it ass sucess type // @Success 200 {object} handler.DataDto
  2. create swag documentation swag init
  3. the below shows as the description
                "data": {
                    "description": "The Individual Records",
                    "type": "array",
                    "items": {
                        "type": "\u0026{%!s(token.Pos=222) string %!s(*ast.InterfaceType=\u0026{233 0xc00039a300 false})}"
                    }
                },

Expected behavior
should be in this case "items":{"type":"object"}

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

Your swag version
e.g. 1.6.3

Your go version
e.g. 1.13.4

Desktop (please complete the following information):

  • OS: Ubuntu
  • IDE: VSCode

Additional context
have tried []map[string]string as well and the type is different but still wrong.

@sdghchj
Copy link
Member

sdghchj commented Dec 20, 2019

I've just commit a PR for map.
Let me PR again for your issue.

@sdghchj sdghchj mentioned this issue Dec 20, 2019
@easonlin404
Copy link
Member

@NamelessHH fixed by #586. please reopen it or raise a new issue if there are any problems.

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

3 participants