Skip to content

Commit

Permalink
Process all the fields in top level request object even if it contain…
Browse files Browse the repository at this point in the history
…s request body (#2155)

## Changes

When regenerating CLI with a new Go SDK
#2126 I've noticed that some
parameters such as `no_compute` for apps are not added as flags for the
CLI commands.

This happened because we ignored all other top level fields if there's a
request body object field.

This PR relies on new AllFields method from Genkit which returns fields
from both request object and request body object.
  • Loading branch information
andrewnester authored Jan 15, 2025
1 parent 581565a commit 2017945
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .codegen/service.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ func new{{.PascalName}}() *cobra.Command {
{{- end}}
{{$method := .}}
{{ if not .IsJsonOnly }}
{{range $request.Fields -}}
{{range .AllFields -}}
{{- if not .Required -}}
{{if .Entity.IsObject }}// TODO: complex arg: {{.Name}}
{{if .Entity.IsObject}}{{if not (eq . $method.RequestBodyField) }}// TODO: complex arg: {{.Name}}{{end}}
{{else if .Entity.IsAny }}// TODO: any: {{.Name}}
{{else if .Entity.ArrayValue }}// TODO: array: {{.Name}}
{{else if .Entity.MapValue }}// TODO: map via StringToStringVar: {{.Name}}
Expand Down
2 changes: 2 additions & 0 deletions cmd/account/federation-policy/federation-policy.go

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

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

1 change: 1 addition & 0 deletions cmd/workspace/apps/apps.go

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

0 comments on commit 2017945

Please sign in to comment.