Skip to content

Repeated method parameters not working #29

@appaquet

Description

@appaquet

Hi,

When trying to use a rest api method's param that supports repeated values (i.e. Vec<T>), it fails at runtime as reqwest 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 type Vec<String>, it is passed as-is to reqwest query: https://github.com/google-apis-rs/generated/blob/master/gen/gmail/v1/lib/src/lib.rs#L8537

I 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:

fn request_method<'a>(http_method: &str, params: impl Iterator<Item = &'a Param>) -> TokenStream {

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 !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions