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

allow headers and params input to generated code #1162

Closed
iscai-msft opened this issue Feb 24, 2022 · 0 comments
Closed

allow headers and params input to generated code #1162

iscai-msft opened this issue Feb 24, 2022 · 0 comments
Assignees
Labels

Comments

@iscai-msft
Copy link
Contributor

iscai-msft commented Feb 24, 2022

This issue is blocked by the release of azure-core (will be released 3/3/2022), because we want to use case_insensitive_dict, which was added in the latest release.

We want to allow users to pass in headers and params as kwargs to generated operations. Additionally, we want individually specified parameters to override these kwargs. For example, if we have foo query param to operation filter, if a user passes in filter(foo="bar", params={"foo": "should not be me"}, we should end up using the value bar because it was individually specified.

We want all of this to be case insensitive, which is why we need case_insensitive_dict from azure-core. The code for this is as follows:

  1. I have an old-ish PR where you can find pretty much all of the code. The difference is this old code did not rely on case_insensitive_dict and used vendored code _get_from_dict. Please remove all vendored code and rely fully on case_insensitive_dict, otherwise the code should pretty much work!
  2. I added additional tests to make sure the behavior of these kwargs is correct, see here. I've added sync and async for each generator, so please be sure to have these tests as part of the PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants