Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jan 25, 2025

Description

Fixes #220

Users were required to convert arrays of strings to comma-separated lists manually, for them to work as parameters in GET requests.
With this fix, the qs library properly encodes arrays as comma-separated lists of values.

Changes for this pull request

  • Added arrayFormat: 'comma' to the options passed to qs.stringify
  • Added the relevant test case for this behavior

@sonarqubecloud
Copy link

@tsolakoua
Copy link
Member

Thanks so much for the contribution to the library @gpembark! It looks great, but I have a question. Is it a backward compatible change? Would it affect the already existing users that were building the comma-separated lists manually?

@ghost
Copy link
Author

ghost commented Feb 10, 2025

Hi @tsolakoua! It shouldn't break for two reasons:

  • the new parameter only applies to encoding arrays, it doesn't change anything it how it was encoding other stuff (and a comma-separated string should just be a string as far as that function is concerned)
  • I assumed so because all the other tests are still passing 😅

Happy to add a specific test case if you prefer, let me know.

@tsolakoua
Copy link
Member

Sounds great @gpembark, thanks a lot for the clear explanation and the contribution :)

@tsolakoua tsolakoua merged commit d4effad into amadeus4dev:master Feb 13, 2025
5 checks passed
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.

Can't pass arrays as parameters to hotels.byCity.get endpoint: it results in a 400 response

2 participants