Skip to content

Sort URL query items #491

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

Merged
merged 7 commits into from
Jul 22, 2021
Merged

Sort URL query items #491

merged 7 commits into from
Jul 22, 2021

Conversation

mihai8804858
Copy link
Contributor

I have an issue with snapshotting an URLRequest that contains multiple query items. When I'm building the URLRequest I'm using a [String: Any] dictionary for queries which results in random order of query items in the final URLRequest.

Copy link
Member

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for taking the time to do this!

I just have a few changes that I will take in before merging.

@mbrandonw
Copy link
Member

@mihai8804858 Looks like the curl tests are failing because they weren't similarly sorted. I suggest either adding sorting to that snapshot strategy, or removing the curl tests.

@mihai8804858
Copy link
Contributor Author

@mbrandonw Added back query sorting for curl.

@mbrandonw mbrandonw merged commit 22b0fbd into pointfreeco:main Jul 22, 2021
@mihai8804858 mihai8804858 deleted the sort-url-query-items branch July 22, 2021 15:13
mac-gallagher pushed a commit to mac-gallagher/swift-snapshot-testing that referenced this pull request Aug 22, 2021
* Sort URL query items

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Sort query items for curl

Co-authored-by: Brandon Williams <[email protected]>
niil-qb pushed a commit to quickbit/swift-snapshot-testing that referenced this pull request Feb 23, 2023
* Sort URL query items

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Update Sources/SnapshotTesting/Snapshotting/URLRequest.swift

* Sort query items for curl

Co-authored-by: Brandon Williams <[email protected]>
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.

2 participants