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

Set query parameter for array of primitive types #929

Merged
merged 3 commits into from
May 14, 2024

Conversation

dhruvCW
Copy link
Contributor

@dhruvCW dhruvCW commented May 11, 2024

Just a rebase of #886 onto the latest changes in master.

Fixes #883

@dhruvCW dhruvCW force-pushed the query_array_params branch from 7b2b5fc to 652ece3 Compare May 11, 2024 07:41
@dhruvCW dhruvCW force-pushed the query_array_params branch from 12f77f1 to c75c927 Compare May 11, 2024 08:12
@dhruvCW dhruvCW force-pushed the query_array_params branch from c75c927 to 69fd9cc Compare May 11, 2024 08:13
@dhruvCW
Copy link
Contributor Author

dhruvCW commented May 11, 2024

Failing tests seem to be because of a network hiccup 😅

Copy link
Member

@LeFnord LeFnord left a comment

Choose a reason for hiding this comment

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

thanks @dhruvCW … is it an addition to #927?
if yes, then I think some things can be refactored, especially stuff from the array_param_type method, or is it an rebase mistake?

lib/grape-swagger/doc_methods/parse_params.rb Outdated Show resolved Hide resolved
@dhruvCW
Copy link
Contributor Author

dhruvCW commented May 13, 2024

thanks @dhruvCW … is it an addition to #927? if yes, then I think some things can be refactored, especially stuff from the array_param_type method, or is it an rebase mistake?

it indeed builds on top of #927 specifically handling the case when an array parameter is incorrectly mapped as formData even when it's part of a GET request. This PR also fixes the problem wherein array parameters always default to formData (this was missed in #927)

@dhruvCW
Copy link
Contributor Author

dhruvCW commented May 13, 2024

I think some things can be refactored, especially stuff from the array_param_type method, or is it an rebase mistake?

could you point them out please 😅 I just rebased the change so I haven't given the implementation itself much thought 😅 I refactored the existing param_type method to also handle array types. That removed the need for an array_param_type method.

@dhruvCW dhruvCW requested a review from LeFnord May 13, 2024 09:05
@LeFnord
Copy link
Member

LeFnord commented May 14, 2024

thanks @dhruvCW

@LeFnord LeFnord merged commit 95be315 into ruby-grape:master May 14, 2024
21 checks passed
@dhruvCW dhruvCW deleted the query_array_params branch May 14, 2024 11:14
@dhruvCW
Copy link
Contributor Author

dhruvCW commented May 14, 2024

thanks for merging the change ❤️ . Could we get a release soon ? This and the previous PR would help fix a long standing issue with the generated swagger docs.

@LeFnord
Copy link
Member

LeFnord commented May 14, 2024

released

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.

Does not support query array parameters
3 participants