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
{{if $multipleBodies}}{{.NameTag}}{{end}}Body {{if eq .NameTag "Multipart"}}*multipart.Reader{{else if ne .NameTag ""}}*{{$opid}}{{.NameTag}}RequestBody{{else}}io.Reader{{end}}
as seen here, when the body is set as required we could drop the pointer on the body.
would you be interested having a PR that change the behavior of the generated code to handle such cases ? we could have an operation-output option like "optional-request-bodies" to switch to this new behavior.
The text was updated successfully, but these errors were encountered:
request bodies should be optional by default
see https://spec.openapis.org/oas/v3.1.0#fixed-fields-10 or https://swagger.io/docs/specification/describing-request-body/
but as we can see here
oapi-codegen/pkg/codegen/templates/strict/strict-http.tmpl
Line 50 in 621b446
https://gist.github.com/emilien-puget/6d0e0af27c72f4cf331991cccfeb96f4#file-strict-http-tmpl-L50
i also made a custom template
https://gist.github.com/emilien-puget/6d0e0af27c72f4cf331991cccfeb96f4#file-strict-interface-tmpl-L15 to handle required body
oapi-codegen/pkg/codegen/templates/strict/strict-interface.tmpl
Line 15 in 621b446
would you be interested having a PR that change the behavior of the generated code to handle such cases ? we could have an operation-output option like "optional-request-bodies" to switch to this new behavior.
The text was updated successfully, but these errors were encountered: