ToCamelCaseWithInitialisms function will convert query-arg style strings to CamelCase with initialisms in uppercase. So, httpOperationId would be converted to HTTPOperationID
(s string)
| 283 | // ToCamelCaseWithInitialisms function will convert query-arg style strings to CamelCase with initialisms in uppercase. |
| 284 | // So, httpOperationId would be converted to HTTPOperationID |
| 285 | func ToCamelCaseWithInitialisms(s string) string { |
| 286 | parts := camelCaseMatchParts.FindAllString(ToCamelCaseWithDigits(s), -1) |
| 287 | for i := range parts { |
| 288 | if v, ok := globalState.initialismsMap[strings.ToLower(parts[i])]; ok { |
| 289 | parts[i] = v |
| 290 | } |
| 291 | } |
| 292 | return strings.Join(parts, "") |
| 293 | } |
| 294 | |
| 295 | var camelCaseMatchParts = regexp.MustCompile(`[\p{Lu}\d]+([\p{Ll}\d]+|$)`) |
| 296 |