Skip to content

Commit

Permalink
fix get upstream operation
Browse files Browse the repository at this point in the history
  • Loading branch information
rucciva committed Aug 27, 2024
1 parent 92716c6 commit 10e7bb2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/proxy/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const prefixUpstream = "upstream-"
func addTemplateFunc(pe ProxyExtension) {
codegen.TemplateFunctions["upstreamOperationID"] = func(opid string) string {
for k, v := range pe.Proxied() {
if opid != k.OperationId {
if opid != codegen.ToCamelCase(k.OperationId) {
continue
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type StrictServerInterface interface {
{{range .}}{{.SummaryAsComment }}
// ({{.Method}} {{.Path}})
{{$opid := .OperationId -}}
{{$opid}}(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{ (or (upstreamOperationID $opid | camelCase) $opid) | ucFirst}}RequestObject, error)
{{$opid}}(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{ (upstreamOperationID $opid | camelCase) | ucFirst}}RequestObject, error)
{{end}}{{/* range . */ -}}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/testoutput/oapi-proxy-impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (p proxyImpl) Profile() http.HandlerFunc {
type serverImpl struct{}

// ProfileGetProfile implements StrictServerInterface.
func (s serverImpl) ProfileGetProfile(ctx context.Context, request ProfileGetProfileRequestObject) (ProfileGetProfileRequestObject, error) {
func (s serverImpl) ProfileGetProfile(ctx context.Context, request ProfileGetProfileRequestObject) (UpstreamProfileGetProfileRequestObject, error) {
panic("unimplemented")
}

Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/testoutput/oapi-proxy.go

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

0 comments on commit 10e7bb2

Please sign in to comment.