From 14192050ae4bbab3e1ae99cf5b0559ad4d5c4a4c Mon Sep 17 00:00:00 2001 From: wwwfeng <32693877+wwwfeng@users.noreply.github.com> Date: Fri, 2 May 2025 17:15:32 +0800 Subject: [PATCH] fix: goctl api tsgen (#4726) --- tools/goctl/api/tsgen/util.go | 4 ++++ 1 file changed, 4 insertions(+) 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, "//")