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

stringifyQuery fix #170

Merged
merged 1 commit into from
Oct 14, 2020
Merged

stringifyQuery fix #170

merged 1 commit into from
Oct 14, 2020

Conversation

Pimm
Copy link
Collaborator

@Pimm Pimm commented Oct 14, 2020

In commit 886de38, we switched from an external alternative to Node.js' querystring module.

Unbeknownst to me, said external alternative has special logic for nested objects on which we rely in a specific endpoint. This commit adds that special logic to our codebase.

Additionally, I added a test to verify the behaviour of stringifyQuery with objects.

Fixes #165.

In commit 886de38, we switched from an external alternative to Node.js' querystring module. Unbeknownst to me, said external alternative has special logic for objects, on which we rely in a specific endpoint (see #165). This commit adds that special logic to our codebase.
Copy link
Collaborator

@dsempel dsempel left a comment

Choose a reason for hiding this comment

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

Bug fix ✅
Unit test ✅
Nothing to add, except that I'm wondering if there might be more endpoints with nested query params. Did you check? It's theoretically possible to have even more deeply nested objects.

@Pimm
Copy link
Collaborator Author

Pimm commented Oct 14, 2020

Correct. This change only fixes this specific scenario: a first level nested object with primitive values (since it doesn't even handle arrays within such an object correctly).

From what I can tell ‒ at least by looking at our type definitions ‒ this is the only endpoint where we have something like this. So we should be OK. If it turns out we need more advanced query strings, I'll introduce smarter code.

@Pimm Pimm merged commit e13021d into master Oct 14, 2020
@Pimm Pimm deleted the pimm/qs branch October 14, 2020 11:12
@Pimm Pimm mentioned this pull request Oct 14, 2020
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.

[BUG][methods]: breaking change
2 participants