You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2026. It is now read-only.
Fix ParamsTypeName template context bug and normalize variable access
Save ParamsTypeName as a local variable before entering nested
range .Bodies loops in client and initiator interface templates,
matching the pattern used by all other templates. Without this,
$.ParamsTypeName fails because $ refers to the root context (a slice
or struct) which has no such field, causing a template error when
generating client code for operations with both params and a body.
Also normalize all initiator templates to consistently save $.Prefix
and $.PrefixLower as $prefix/$prefixLower at the top of the
range .Operations loop and use the saved variables throughout, instead
of mixing direct root context access ($.Prefix) with saved variables.
Fixes#1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
// New{{ $opid }}{{ $prefix }}Request{{ if.HasBody }}WithBody{{ end }} creates a {{ .Method }} request for the {{ $.PrefixLower }}{{ if.HasBody }} with any body{{ end }}
32
+
// New{{ $opid }}{{ $prefix }}Request{{ if.HasBody }}WithBody{{ end }} creates a {{ .Method }} request for the {{ $prefixLower }}{{ if.HasBody }} with any body{{ end }}
32
33
func New{{ $opid }}{{ $prefix }}Request{{ if.HasBody }}WithBody{{ end }}(targetURL string{{ if$hasParams }}, params *{{ $paramsTypeName }}{{ end }}{{ if.HasBody }}, contentType string, body io.Reader{{ end }}) (*http.Request, error) {
0 commit comments