serde_qs icon indicating copy to clipboard operation
serde_qs copied to clipboard

Support preserving order of parameters when serializing to a Map.

Open wuerges opened this issue 1 year ago • 1 comments

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 avatar May 29 '24 20:05 wuerges