emicklei / go-restful-swagger12

Swagger 1.2 extension to the go-restful package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

numeric enum not supported

vikstrous opened this issue · comments

Example struct:

type Thing struct {
	Status                 int       `json:"status" enum:"0|1|2|3|4|5|6|7"`
}

The output swagger json has the enum values as a list of strings. Then when you use go-swagger to generate an API client, it panics in an init() function because it's trying to deserialize an array of strings into an array of ints. Long story short, these enum values should serialize into an array of ints instead in this case.

do you have a suggestion to fix this?