Pass .Required to BindStyledParameterWithLocation and BindStyledParameter#1315
Pass .Required to BindStyledParameterWithLocation and BindStyledParameter#1315jamietanna merged 6 commits intooapi-codegen:masterfrom
.Required to BindStyledParameterWithLocation and BindStyledParameter#1315Conversation
|
@renom mind updating the code to follow the changes introduced in https://github.com/oapi-codegen/runtime/releases/tag/v1.1.0 for this? 🙏 Or are you happy with #1353 taking this? |
|
It's okay, I can update the code. I have a few questions though. How do I know if the code is updated right? Will it be enough to update runtime to v1.1.0 and check that cmd/oapi-codegen builds fine? |
|
Thank you! Yes, exactly - once bumping We may want to add an integration test (in https://github.com/deepmap/oapi-codegen/blob/master/internal/test/parameters/parameters_test.go) to validate that the underlying issue in #954 is resolved |
|
I updated |
| {{end}} | ||
| {{if .IsStyled}} | ||
| err = runtime.BindStyledParameter("{{.Style}}",{{.Explode}}, "{{.ParamName}}", c.Params("{{.ParamName}}"), &{{$varName}}) | ||
| err = runtime.BindStyledParameter("{{.Style}}", {{.Explode}}, {{.Required}}, "{{.ParamName}}", c.Params("{{.ParamName}}"), &{{$varName}}) |
There was a problem hiding this comment.
I think this will fail now, as we've introduced a new function BindStyledParameterWithOptions - mind refactoring these templates to use that new function now?
jamietanna
left a comment
There was a problem hiding this comment.
Thank you 👏🏽 well also need to run make generate and then commit the changes
|
Ready to be merged. |
|
Thank you @renom 👏 cc @itpavelkozlov |
.Required to BindStyledParameterWithLocation and BindStyledParameter
…ly (oapi-codegen#1315) Corresponding with changes in the runtime package, we want to ensure we let the (newly added) `BindStyledParameterWithOptions` function knows whether a parameter is required, to not error when an empty value is provided. Closes oapi-codegen#954.
Fixes #954
Works along with oapi-codegen/runtime/pull/14