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

Support preserving order of parameters when serializing to a Map. #106

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wuerges
Copy link

@wuerges wuerges commented May 29, 2024

Dear samscott89,
Please consider this pull request.

What it does?

This PR adds support for deserializing queries into ordered maps, such as IndexMap.

How?

It adds a new feature, called indexmap, that replaces the BTreeMap used internall by serd_qs with an IndexMap.

Why?

Sometimes the order of the keys in the query is important. On example is sorting. What if you want to sort by one field, and then by other?

Was it tested?

There's a new test. It parses a two queries into a map. The queries are almost the same, but the order of the keys is swapped.

@wuerges wuerges changed the title Parse to indexmap Support preserving order of parameters when serialized to a Map. Jun 3, 2024
@wuerges wuerges changed the title Support preserving order of parameters when serialized to a Map. Support preserving order of parameters when serializing to a Map. Jun 3, 2024
@davidrjonas
Copy link

Hey, this is exactly what I need! Any chance this will be merged soon?

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