-
Notifications
You must be signed in to change notification settings - Fork 219
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
Query parameters included on JSON.stringify even when omitted #936
Comments
I have ran into this same issue and even if I add query parameters this is all I get. The same occurs for urlencoded body. |
@tklun @jbelford you are directly trying to stringify the complete Collection object by doing
The query parameters will be correctly parsed if you first convert the collection object to JSON Object(by doing collection.toJSON()) and then stringify. The right way of stringifying the collection object is as follows:
|
Did you really test it? I still can reproduce it in both examples. |
I found it out. You really need to call Invalid collectionDefinition.item?.push({
name: op.Name,
request: new Request(request),
}); valid collectionDefinition.item?.push({
name: op.Name,
request: new Request(request).toJSON(),
}); |
Hi Everybody! @StarpTech I tried your solution but I still get the postman_listIndex polluted query params |
Couldn't get it to work either :/ at this point im just writing my own types |
Currently, when I construct a
Url
without any query parameters, the instance of theurl
works as expected in isolation. BothtoString()
andtoJSON()
leave out any query string.However, when I add the same url to a collection, the
query
value is filled with a lot of extra fields that persist when imported back into Postman.The code:
outputs:
If I'm doing something incorrectly, would someone be able to point me in the right direction?
The text was updated successfully, but these errors were encountered: