-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
bug: URL Query parameter not bind to Optional
proto message field
#4660
Comments
Hi. Thanks for the example. Does it work if you don't use |
Yes, it works as expected |
Ah, very cool! We haven't yet put time into supporting the optional keyword, so this sounds like a bug. The code you want to look at is in Lines 48 to 65 in ffc4120
|
Optional
proto message field
@johanbrandhorst if no one is working on this I can take this up :) |
Please go for it! |
Hey @johanbrandhorst @afifurrohman-id So I did some investigation and created a demo as per as bug reported. But it was working fine for me. I am attaching repo, so you guys can let me know if something is wrong from my side. https://github.com/lemonnn-8/grpc-gateway-demo looking forward to your reply :) |
I can confirm now this working, i also re-generate the stubs output. i can see that buf registry update the googleapis dep: https://buf.build/googleapis/googleapis/commits/commit/e7f8d366f5264595bcc4cd4139af9973 but is not related to but i think googleapis |
@johanbrandhorst I think we can close this issue then |
Update, after long debugging i found where the problem comes. The |
🐛 Bug Report
When using
optional
field as request message and will be expected to bind with HTTPurl query parameter
the optional field alwaysnil
To Reproduce
buf.gen.yaml
buf.yaml
svc.proto
url?soft_delete=true
orurl?soft_delete=false
Expected behavior
it should either
false
ortrue
Actual Behavior
Soft delete it will always
nil
Your Environment
Linux GRPC-GATEWAY 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: