golang enum support in swagger codegen

905 views Asked by At

I am not able to generate the enum with swagger codegen for golang. What modification needs to be done in go model.mustache and GoClientCodegen.java ?

I tried this in mustache :

{{>partial_header}}
package {{packageName}}
{{#models}}{{#imports}}
import ({{/imports}}{{#imports}}
"{{import}}"{{/imports}}{{#imports}}
)
{{/imports}}{{#model}}{{#description}}
// {{{description}}}{{/description}}
type {{classname}} struct {
{{#vars}}{{#description}}
// {{{description}}}{{/description}}
{{name}} {{{datatype}}} `json:"{{baseName}},omitempty"`
{{/vars}}
}
{{#enum}}
type enum string
const (
"COMPLETE"
"INCOMPLETE"
)
{{/enum}}
{{/model}}{{/models}}

GoClientCodegen.java is same. What needs to be modified in the java file and the mustache file ?

0

There are 0 answers