Skip to content
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

fix: make BindQueryParameter play along with x-go-type-skip-optional-pointer #47

Conversation

swistakm
Copy link
Contributor

@swistakm swistakm commented Jul 9, 2024

I've run into the same issue as described in oapi-codegen/oapi-codegen#1344 with in: query parameters annotated with x-go-type-skip-optional-pointer extension.

I was a bit surprised at the beginning because codegen generates the code with plain struct field (i.e. skips pointer) as expected in the query string params struct but fails with panic during runtime. Turns out it wasn't that hard to fix and it seems am useful addition for users that desire zero values for optional parameters instead of pointers with nil value to communicate lack of parameter.

@swistakm swistakm requested a review from a team as a code owner July 9, 2024 13:58
@mromaszewicz mromaszewicz merged commit 8c8696b into oapi-codegen:main Jul 9, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants