althonos / packageurl.rs

Rust implementation of the Package URL specification.
MIT License
8 stars 6 forks source link

Add optional serde support #3

Closed TedDriggs closed 3 years ago

TedDriggs commented 3 years ago

Right now, PackageUrl doesn't implement serde::Serialize or serde::Deserialize, but does implement ToString and FromStr. To use PackageUrl in a struct that is #[derive(Serialize)], someone needs to add the #[serde(with = "...")] attribute.

Proposal: Add a serde feature to packageurl which lights up Serialize and Deserialize impls for PackageUrl.

althonos commented 3 years ago

The new v0.3.0 release now derives Serialize and Deserialize when the serde feature is enabled. Thanks for the heads-up!