Skip to content

Commit

Permalink
changes for http template to be able to handle optional fields in pat…
Browse files Browse the repository at this point in the history
…h params (#561)
  • Loading branch information
abhishekparwal committed Feb 13, 2019
1 parent b341b6c commit a762e26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions codegen/template_bundle/template_files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/templates/http_client.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (c *{{$clientName}}) {{$methodName}}(
fullURL := c.httpClient.BaseURL
{{- range $k, $segment := .PathSegments -}}
{{- if eq $segment.Type "static" -}}+"/{{$segment.Text}}"
{{- else -}}+"/"+string(r{{$segment.BodyIdentifier | title}})
{{- else -}}+"/"+string({{- if not $segment.Required }} * {{- end -}}r{{$segment.BodyIdentifier | title}})
{{- end -}}
{{- end}}

Expand Down

0 comments on commit a762e26

Please sign in to comment.