diff --git a/cmd/apps/crtapp/crtapp.go b/cmd/apps/crtapp/crtapp.go index eb530148..da43fabf 100644 --- a/cmd/apps/crtapp/crtapp.go +++ b/cmd/apps/crtapp/crtapp.go @@ -19,7 +19,10 @@ var Cmd = &cobra.Command{ app := []string{} app = append(app, "\"name\":\""+name+"\"") - app = append(app, "\"apiProducts\":[\""+getArrayStr(apiProducts)+"\"]") + + if len(apiProducts) > 0 { + app = append(app, "\"apiProducts\":[\""+getArrayStr(apiProducts)+"\"]") + } if callback != "" { app = append(app, "\"callbackUrl\":\""+callback+"\"") @@ -71,7 +74,6 @@ func init() { _ = Cmd.MarkFlagRequired("name") _ = Cmd.MarkFlagRequired("email") - _ = Cmd.MarkFlagRequired("prods") } func getArrayStr(str []string) string {