diff --git a/tools/goctl/api/tsgen/util.go b/tools/goctl/api/tsgen/util.go index d105eea70..df6e95c4c 100644 --- a/tools/goctl/api/tsgen/util.go +++ b/tools/goctl/api/tsgen/util.go @@ -34,6 +34,10 @@ func writeProperty(writer io.Writer, member spec.Member, indent int) error { return err } + if strings.Contains(name, "-") { + name = fmt.Sprintf("'%s'", name) + } + comment := member.GetComment() if len(comment) > 0 { comment = strings.TrimPrefix(comment, "//")