Skip to content

Commit

Permalink
fix(gen): set Explode:false for multipart arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Liooo committed Oct 6, 2024
1 parent 4182357 commit d185c73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gen/_template/request_decode.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ func (s *{{ if $op.WebhookInfo }}Webhook{{ end }}Server) decode{{ $op.Name }}Req
cfg := uri.QueryParameterDecodingConfig{
Name: {{ quote $p.Spec.Name }},
Style: uri.QueryStyle{{ capitalize $p.Spec.Style.String }},
Explode: {{ if $p.Spec.Explode }}true{{ else }}false{{ end }},
{{- /* NOTE: set Explode to false for multipart form arrays, see: */}}
Explode: {{ if and ($p.Spec.Explode) (ne $p.Type.Kind "array") }}true{{ else }}false{{ end }},
{{- if isObjectParam $p }}
Fields: {{ paramObjectFields $p.Type }},
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions internal/integration/test_form/oas_request_decoders_gen.go

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

0 comments on commit d185c73

Please sign in to comment.