diff --git a/.codegen/service.go.tmpl b/.codegen/service.go.tmpl index d9bfebd4..89363235 100644 --- a/.codegen/service.go.tmpl +++ b/.codegen/service.go.tmpl @@ -58,7 +58,7 @@ func init() { {{if .Request}}// TODO: short flags {{.CamelName}}Cmd.Flags().Var(&{{.CamelName}}Json, "json", `either inline JSON string or @path/to/file.json with request body`) {{$method := .}} - {{ if not .JsonOnly }} + {{ if not .IsJsonOnly }} {{range .Request.Fields -}} {{- if not .Required -}} {{if .Entity.IsObject }}// TODO: complex arg: {{.Name}} @@ -135,7 +135,7 @@ var {{.CamelName}}Cmd = &cobra.Command{ } {{- end -}} {{$method := .}} - {{- if and .Request.IsAllRequiredFieldsPrimitive (not .JsonOnly) -}} + {{- if and .Request.IsAllRequiredFieldsPrimitive (not .IsJsonOnly) -}} {{- range $arg, $field := .Request.RequiredFields}} {{if not $field.Entity.IsString -}} _, err = fmt.Sscan(args[{{$arg}}], &{{$method.CamelName}}Req.{{$field.PascalName}})