Closed IgnisDa closed 7 months ago
It would be great if skip_serializing_none
is supported since otherwise there are a lot of null
s in the export performed.
Thanks for the report! I was able to reproduce this locally. The Serializer
implementation in Struson validates the provided len
to methods such as serialize_struct
, but it seems I got the handling in skip_field
incorrect, leading to the error you are seeing. I will fix that in that next days.
However, I am also considering removing validation of the len
(see #42) since Serde JSON's implementation does not validate it either.
Thanks for taking a look!
However, I am also considering removing validation of the len (see https://github.com/Marcono1234/struson/issues/42) since Serde JSON's implementation does not validate it either.
In my case, since the JSON is already validated, the struson validation is not required. But maybe you are aware of use-cases where it might be required. Either way, it is fine if you remove the validation for my use-case.
This should be fixed in version 0.4.1, please let me know if you encounter any other issues.
And thanks for considering to use Struson!
Works perfectly now, thanks!
This was the reason #40 happened for me. Removing
#[skip_serializing_none]
from my struct gets everything working again.Ref: https://docs.rs/serde_with/3.1.0/serde_with/attr.skip_serializing_none.html