-
Notifications
You must be signed in to change notification settings - Fork 15
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
Repeated method parameters not working #29
Comments
Thanks for the report. You're correct about the location in the generator that needed to be fixed. 9ad1f06 should have the fix. @mwilliammyers Would you mind regenerating the bindings whenever you get a chance? |
I tried generating it again but ran into some issues, so I will try again later when I have more time to fix the issues. |
Hey guys! Any progress on this? |
@doivosevic Sorry for the late response, I updated them all in google-apis-rs/generated@318cd3b1. All of the libs build, but many of the CLI bins do not. |
Hi,
When trying to use a rest api method's param that supports repeated values (i.e.
Vec<T>
), it fails at runtime asreqwest
expects repeated fields to be passed in a&[(param, value1), (param, value2)]
format instead of&[(param, values)]
format (see reqwest's request.rs).Example: In Gmail's list threads request, for parameter
label_ids
of typeVec<String>
, it is passed as-is toreqwest
query: https://github.com/google-apis-rs/generated/blob/master/gen/gmail/v1/lib/src/lib.rs#L8537I tried to dig down on how the generator generates the method. As I understand it, it would need to remap repeated parameters to
reqwest
expected format in here:generator/google_rest_api_generator/src/method_builder.rs
Line 368 in a848301
Let me know if you need more info. I'm willing to take a stab at it if you can describe how you envision the fix.
Thanks !
The text was updated successfully, but these errors were encountered: