Skip to content

Commit

Permalink
url.PathEscape path params
Browse files Browse the repository at this point in the history
  • Loading branch information
AitanG authored Sep 18, 2024
1 parent 00d6c5c commit 3d68cdc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/resources/handlebars/go/api.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{{>partial_header}}
package {{packageName}}

Expand Down Expand Up @@ -64,7 +63,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}

// create path and map variables
localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}}
localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}}
localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", url.PathEscape({{paramName}})), -1){{/pathParams}}

localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
Expand Down Expand Up @@ -275,4 +274,4 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}

return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, nil
}
{{/@first}}{{/contents}}{{/operation}}{{/operations}}
{{/@first}}{{/contents}}{{/operation}}{{/operations}}

0 comments on commit 3d68cdc

Please sign in to comment.