(relativePath string)
| 792 | } |
| 793 | |
| 794 | func generatePathParameters(relativePath string) ([]whisk.ApiParameter, error) { |
| 795 | pathParams := []whisk.ApiParameter{} |
| 796 | |
| 797 | pathParamNames, err := getPathParameterNames(relativePath) |
| 798 | if len(pathParamNames) > 0 && err == nil { |
| 799 | // Only create unique swagger entries |
| 800 | var uniqueParamNames []string |
| 801 | for _, name := range pathParamNames { |
| 802 | if !contains(uniqueParamNames, name) { |
| 803 | uniqueParamNames = append(uniqueParamNames, name) |
| 804 | } |
| 805 | } |
| 806 | for _, uniqueName := range uniqueParamNames { |
| 807 | whisk.Debug(whisk.DbgInfo, "Creating api parameter for '%s'\n", uniqueName) |
| 808 | param := whisk.ApiParameter{Name: uniqueName, In: "path", Required: true, Type: "string", |
| 809 | Description: wski18n.T("Default description for '{{.name}}'", map[string]interface{}{"name": uniqueName})} |
| 810 | pathParams = append(pathParams, param) |
| 811 | } |
| 812 | } |
| 813 | |
| 814 | return pathParams, err |
| 815 | } |
| 816 | |
| 817 | /* |
| 818 | * if # args = 4 |
no test coverage detected