diff --git a/generator/main.go b/generator/main.go index d383d39..3dadd29 100644 --- a/generator/main.go +++ b/generator/main.go @@ -649,13 +649,8 @@ func fmtQueryParamType() *jen.Statement { return jen.Index(jen.Lit(queryParamArraySize)).String() } +var reNonWord = regexp.MustCompile(`\W+`) + func customCamelCase(s string) string { - // Split the string by ":" - parts := strings.Split(s, ":") - for i, part := range parts { - // Convert each part to camelCase using strcase.ToCamel - parts[i] = strcase.ToCamel(part) - } - // Join the parts back together - return strings.Join(parts, "") + return strcase.ToCamel(reNonWord.ReplaceAllString(s, "_")) } diff --git a/handler/kafkatopic/kafkatopic.go b/handler/kafkatopic/kafkatopic.go index 9063660..2f92ea4 100644 --- a/handler/kafkatopic/kafkatopic.go +++ b/handler/kafkatopic/kafkatopic.go @@ -142,7 +142,7 @@ type CleanupPolicyType string const ( CleanupPolicyTypeDelete CleanupPolicyType = "delete" CleanupPolicyTypeCompact CleanupPolicyType = "compact" - CleanupPolicyTypeCompactdelete CleanupPolicyType = "compact,delete" + CleanupPolicyTypeCompactDelete CleanupPolicyType = "compact,delete" ) func CleanupPolicyTypeChoices() []string {