-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
Describe the bug
Incorrect parsing of sample string slices containing commas.
To Reproduce
When I defined the following structure and generate swagger using swag init.
type Example struct {
Messages []string `json:"Messages" example:"\"a,b,c\",\"a,b,c\""`
}Outputted like this.
definitions:
main.Example:
properties:
Messages:
example:
- '"a'
- b
- c"
- '"a'
- b
- c"
items:
type: string
type: array
type: objectExpected behavior
I expect to output like
definitions:
main.Example:
properties:
Messages:
example:
- "a,b,c"
- "a,b,c"
items:
type: string
type: array
type: objectYour swag version
v1.6.9
I think, It will be able to fix by modify the code to use csv reader alternative to use strings.Split.
rthier-ifood