(opName string, requestPath string)
| 896 | } |
| 897 | |
| 898 | func generateDefaultOperationID(opName string, requestPath string) (string, error) { |
| 899 | if opName == "" { |
| 900 | return "", fmt.Errorf("operation name cannot be an empty string") |
| 901 | } |
| 902 | if requestPath == "" { |
| 903 | return "", fmt.Errorf("request path cannot be an empty string") |
| 904 | } |
| 905 | |
| 906 | operationID := strings.ToLower(opName) |
| 907 | for part := range strings.SplitSeq(requestPath, "/") { |
| 908 | if part != "" { |
| 909 | operationID = operationID + "-" + part |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | return nameNormalizer(operationID), nil |
| 914 | } |
| 915 | |
| 916 | // GenerateBodyDefinitions turns the Swagger body definitions into a list of our body |
| 917 | // definitions which will be used for code generation. |
no outgoing calls