-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Currently, if I create an enumeration that's represented by a string in JSON, the generated swagger type is integer.
When I submit that property value as a string in swagger, it silently fails until I change the value to be a number, but then the JSON marshalling fails.
What would be good is to add support for a field tag so the type can be overridden. Something like:
type Model struct {
type MyType `swagno:"string"`
}
And then:
fieldType := (field.Tag.Get("swagno"))
if fieldType == "" {
fieldType = getType(field.Type.Kind().String())
}
Metadata
Metadata
Assignees
Labels
No labels