-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http strict request bodies should be optional by default #1584
Labels
Comments
Interesting, thank you! Yes we'd appreciate a PR for that, and agreed that having it behind |
2 tasks
started to do stuff and things regarding this issue there |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: