This adds support for query strings in which a sequence field of a
`Deserialize` / `Serialize` struct is (de)serialized as
`field=val1&field=val2&field=val3`, instead of the more common
`field[]=val1&field[]=val2&field[]=val3` syntax.
68: Allow serialization of unit type r=nox a=maxv-rust
That changes provides support for unit type serialization.
It may looks like it doesn't make sense to serialize `()`. Unfortunately that kind of serialization may be necessary for generic structures where one of generic argument may be `()`.
Closes#69
Co-authored-by: MaxV <60802079+maxv-rust@users.noreply.github.com>
64: Add Error::source r=nox a=AnderEnder
As discussed in https://github.com/nox/serde_urlencoded/pull/63 `Error::source` was added in `1.30.0`
This PR implements `Error::source`
Co-authored-by: Andrii Radyk <ander.ender@gmail.com>
59: Expose lifetimes in UrlEncodedSerializer r=nox a=benesch
Forcing UrlEncodedSerializer to have a 'static lifetime is unnecessarily
restrictive and breaks a downstream dependency, reqwest. Thread a new
lifetime through to fix the problem.
Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
Forcing UrlEncodedSerializer to have a 'static lifetime is unnecessarily
restrictive and breaks a downstream dependency, reqwest. Thread a new
lifetime through to fix the problem.
45: Fix struct newtype deserialization (and add tests) r=nox a=samsieber
Fixes#41
I only had to fix the deserializer - the serialization already works. So now they work the same way - you can serialize something and then deserialize it losslessly.
I also added tests for serialization and deserialization. Let me know if there's anything you'd like changed.
Co-authored-by: Sam Sieber <swsieber@gmail.com>