0

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 ?

William Cheng
  • 10,137
  • 5
  • 54
  • 79
Jeet
  • 761
  • 3
  • 10
  • 27
  • Please open an "issue" in https://github.com/swagger-api/swagger-codegen/issues/new so that we can look into the issue with a spec you provided. – William Cheng Dec 22 '16 at 17:01
  • Have posted in swagger-codegen as new issue.. I am new and not able to figure out how can I generate enum with the same model.mustache as I dont see the support for the same in the mustache file. I can see that DefaultCodegen has the option but I m not able to understand it for reusing. I feel that something must be added within mustache file to support the same and GoClientCodegen as well needs to be modified. – Jeet Dec 23 '16 at 09:16

0 Answers0