Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Missing support for Default trait #119

Closed
macisamuele opened this issue Dec 1, 2018 · 2 comments
Closed

Missing support for Default trait #119

macisamuele opened this issue Dec 1, 2018 · 2 comments

Comments

@macisamuele
Copy link
Contributor

Would be nice if serde-yaml would allow the following: serde_yaml::Value::default().

This is currently a partial blocker for a personal project I'm working on.

I would ask if there are objections on allowing a default value for serde-yaml like is done on serde-json.

My suggestion would be to use Value::Null as default value

@dtolnay
Copy link
Owner

dtolnay commented Dec 1, 2018

I would accept a PR to add a Default impl.

@macisamuele
Copy link
Contributor Author

@dtolnay thanks a lot for the immediate response 😄
I had a local branch that I was using to validate if the default requirement was needed or there were easy/nice way to workaround the issue.

By defining a default value, my project would be much simplified and this library would get the handling of default for structs deserialization

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants