-
Notifications
You must be signed in to change notification settings - Fork 669
Add support for hash
and Array of hashes
data types
#1735
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
Comments
So there seems to be some sort of support for Lines 47 to 56 in a349793
|
Does this issue prevent the ability of using For example, when retrieving merge requests that a reviewer has not yet approved, I was thinking it would be something like: gl.mergerequests.list(query_parameters={
"scope": "all",
"state": "open",
"reviewer_username": "some.user",
"not[approved_by_username][]": "some-user",
}, iterator=True) Here's the logs of what is generated by the above attempt:
That does not seem to work though, perhaps due to the encoding of the square brackets? I also tried: gl.mergerequests.list(query_parameters={
'scope': 'all',
'state': 'opened',
'reviewer_username': 'some.user',
'not': {
'approved_by_usernames': ['some.user']
}
}, iterator=True) That didn't seem to work either. Is this not currently possible? The Gitlab UI itself generates query parameters such as the following for it:
I also came across https://gitlab.com/gitlab-org/gitlab/-/issues/358418 which talks about potentially changing the Gitlab API to respect RFC 6570 encoding of parameters like this that was a bit related to this topic. Thanks for the great library! |
@fletchowns I don't think that will work. Now you might try doing: Maybe that would work but I don't know. EDIT: Oh I see you attempted that already. So never mind |
Thank you for the suggestion @JohnVillalovos . I had not tried exactly that, but I just tried that as well and it does not seem to work:
Resulting URL from debug logs:
|
I tried using http_get as a workaround, but that seemed to have the encoding issue as well:
It really doesn't like those square brackets! It seems like encoding them should be the correct behavior though. Is it the gitlab API that is not following URL encoding standards here? To run a similar request via cURL, I have to use
As a workaround for my particular use case, I am doing the filtering myself by sifting through the approvals response (this API doesn't seem to be supported yet by the library, so using low level method here):
|
@fletchowns So it seems like |
We need to add support for
hash
andArray of hashes
types.https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
Currently we don't support either of these. Also at this moment there is a PR #1699 open to better support handling
array
types.A related issue is #1732
The text was updated successfully, but these errors were encountered: