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

Updated connector's urlencoding logic for proper array encoding #287

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

achernevskii
Copy link
Collaborator

@achernevskii achernevskii commented Oct 5, 2021

Issue Description

The client was unable to perform array-search, because query parameters containing array was URL-encoded like this:

Parameter URL-Encoding
{'array_option': ['value1', 'value2']} ...?array_option=%5B%27value1%27%2C+%27value2%27%5D

Instead, every entry in an array should be URL-encoded as a separate key/value pair. Like this:

Parameter URL-Encoding
{'array_option': ['value1', 'value2']} ...?array_option=value1&array_option=value2

How It Was Fixed

Unit Tests

  • test_construct_url_with_query_params_containing_array -- checks if Connector's _construct_url method encodes array as it was described earlier.

Reviewers

@anagha-infoblox, @somashekhar

* Now arrays in query params will be urlencoded as a set of key/value pairs.
  Each key/value will represent entry in respective array.

* This will make array-search possible.
@achernevskii
Copy link
Collaborator Author

@anagha-infoblox, @somashekhar please take a look.

Copy link
Contributor

@anagha-infoblox anagha-infoblox left a comment

Choose a reason for hiding this comment

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

LGTM

@anagha-infoblox anagha-infoblox merged commit d3131bd into infobloxopen:master Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to search for string array types with get_object?
2 participants