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

(feature, csharp): Add support for allow-multiple query params #4157

Merged
merged 10 commits into from
Jul 31, 2024

Conversation

amckinney
Copy link
Contributor

This adds support for allow-multiple query parameters, which are serialized in explode format (e.g. &foo=one&foo=two).

The change takes place in two files:

  • The RawClient.cs core utility now supports IEnumerable collection types in the BuildUrl helper.
    • The string type requires special handling since it is the only primitive that implements the IEnumerable interface.
  • The query parameters are attached to the _query parameter with simple LINQ expressions like the following:
var _query = new Dictionary<string, object>() { };
_query["operand"] = request
    .Operand.Select(_value => JsonSerializer.Serialize(_value))
    .ToList();

There's still some missing functionality here. As it stands, we don't support deepObject query parameters, so we'll likely need to revisit the BuildUrl implementation.

@amckinney amckinney requested a review from dsinghvi as a code owner July 30, 2024 22:21
@dsinghvi dsinghvi requested a review from dcb6 July 30, 2024 22:30
Copy link
Contributor

@dcb6 dcb6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants