fix(goctl): restore API summaries in swagger generation (#5237)

This commit is contained in:
Kevin Wan
2025-10-12 11:38:58 +08:00
committed by GitHub
parent 3f756a2cbf
commit bea9d150a1
2 changed files with 112 additions and 2 deletions

View File

@@ -24,10 +24,15 @@ func getFirstUsableString(def ...string) string {
}
for _, val := range def {
str, err := strconv.Unquote(val)
if err == nil && len(str) != 0 {
// Try to unquote if it's a quoted string
if str, err := strconv.Unquote(val); err == nil && len(str) != 0 {
return str
}
// Otherwise, use the value as-is if it's not empty
if len(val) != 0 {
return val
}
}
return ""