-
Notifications
You must be signed in to change notification settings - Fork 59
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
Custom serialize issue #25
Comments
DmitrySamoylov
added a commit
to DmitrySamoylov/yaserde
that referenced
this issue
Jan 15, 2020
DmitrySamoylov
added a commit
to DmitrySamoylov/yaserde
that referenced
this issue
Jan 15, 2020
@victor-soloviev can you check the newest version if it's fixed your issue ? |
I close the issue, re-open it if needed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are there any examples of a custom deserializer and/or serializer definition? This feature is mentioned in README, but I struggle to find out the correct way to use it.
When I try to define a
serialize
function for my type, yaserde serializes it twice during the outer struct serialization for some reason. Here is an example of this issue:Output:
The example above is synthetic, but it shows the issue. It does not matter if I use begin_element/end_element in my
serialize
function to have tags around value. When called forDay
it produces "test" once, but when called for 'Date` it serializes the 'day' field twice.Here is the code produced my macro obtained with
cargo expand
, which indeed has two serializations forday
:The text was updated successfully, but these errors were encountered: