fix(schema): keep repeated query metadata and honor array params#301
fix(schema): keep repeated query metadata and honor array params#301sonwr wants to merge 1 commit intogoogleworkspace:mainfrom
Conversation
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the handling of repeated query parameters within the API client. It ensures that the generated schema accurately reflects whether a parameter can be repeated and modifies the request builder to correctly serialize array values into multiple key-value pairs for such parameters, aligning with standard API conventions for repeated query parameters. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements support for repeated query parameters by modifying query_params to be a Vec of tuples in src/executor.rs, which allows for multiple query parameters with the same key. The logic in build_url is updated to expand array values for parameters marked as repeated. The changes also update src/schema.rs to include the repeated field in the schema output. The new functionality is covered by tests. I have not identified any issues of high or critical severity.
This fixes #300.
gws schemanow preservesrepeated: truefor method parameters, and request execution now expands JSON array values into repeated query keys for parameters marked as repeated in discovery docs.Example behavior after this change:
metadataHeadersappears withrepeated: trueingws schema gmail.users.messages.get--params '{"metadataHeaders":["Subject","Date","From"]}'sends repeated query pairsVerification:
~/.cargo/bin/cargo test test_param_to_json -- --nocapture~/.cargo/bin/cargo test test_build_url_ -- --nocapture~/.cargo/bin/cargo run -- schema gmail.users.messages.get(confirmedmetadataHeaders.repeated=truein output)