Skip to content

Commit

Permalink
Fixed jobs create command to only accept JSON payload
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnester committed Jun 19, 2023
1 parent 4a03265 commit eddfbd2
Show file tree
Hide file tree
Showing 21 changed files with 251 additions and 80 deletions.
10 changes: 6 additions & 4 deletions .codegen/service.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func init() {
{{if .Request}}// TODO: short flags
{{.CamelName}}Cmd.Flags().Var(&{{.CamelName}}Json, "json", `either inline JSON string or @path/to/file.json with request body`)
{{$method := .}}
{{range .Request.Fields -}}
{{ if not .OnlyPayload }}
{{range .Request.Fields -}}
{{- if not .Required -}}
{{if .Entity.IsObject }}// TODO: complex arg: {{.Name}}
{{else if .Entity.IsAny }}// TODO: any: {{.Name}}
Expand All @@ -69,8 +70,9 @@ func init() {
{{else}}{{$method.CamelName}}Cmd.Flags().{{template "arg-type" .Entity}}(&{{$method.CamelName}}Req.{{.PascalName}}, "{{.KebabName}}", {{$method.CamelName}}Req.{{.PascalName}}, `{{.Summary | without "`"}}`)
{{end}}
{{- end -}}
{{- end}}
{{end}}
{{- end}}
{{- end}}
{{end}}
}
{{- $excludeFromPrompts := list "workspace get-status" -}}
{{- $fullCommandName := (print $serviceName " " .KebabName) -}}
Expand Down Expand Up @@ -133,7 +135,7 @@ var {{.CamelName}}Cmd = &cobra.Command{
}
{{- end -}}
{{$method := .}}
{{- if .Request.IsAllRequiredFieldsPrimitive -}}
{{- if and .Request.IsAllRequiredFieldsPrimitive (not .OnlyPayload) -}}
{{- range $arg, $field := .Request.RequiredFields}}
{{if not $field.Entity.IsString -}}
_, err = fmt.Sscan(args[{{$arg}}], &{{$method.CamelName}}Req.{{$field.PascalName}})
Expand Down
4 changes: 2 additions & 2 deletions cmd/account/budgets/budgets.go

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

2 changes: 1 addition & 1 deletion cmd/account/credentials/credentials.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.

2 changes: 1 addition & 1 deletion cmd/account/encryption-keys/encryption-keys.go

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

6 changes: 3 additions & 3 deletions cmd/account/ip-access-lists/ip-access-lists.go

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

2 changes: 1 addition & 1 deletion cmd/account/storage/storage.go

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

2 changes: 1 addition & 1 deletion cmd/account/workspace-assignment/workspace-assignment.go

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

180 changes: 180 additions & 0 deletions cmd/workspace/access-control-proxy/access-control-proxy.go

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

4 changes: 2 additions & 2 deletions cmd/workspace/alerts/alerts.go

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

Loading

0 comments on commit eddfbd2

Please sign in to comment.