Skip to content
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

Add documentation for (de)serializing enum variants #501

Closed
bestouff opened this issue Jun 6, 2019 · 5 comments
Closed

Add documentation for (de)serializing enum variants #501

bestouff opened this issue Jun 6, 2019 · 5 comments

Comments

@bestouff
Copy link
Contributor

bestouff commented Jun 6, 2019

Let's say I have this enum:

#[derive(Serialize, Deserialize)]
enum Test {
    A(Url, OtherType),
}

The documentation is missing for writing this type correctly - there's probably a magic incantation about #[serde(with = "url_serde")] somewhere but I couldn't find it easily.

@jdm
Copy link
Member

jdm commented Jun 6, 2019

The documentation exists in the url_serde crate: https://docs.rs/url_serde/0.2.0/url_serde/#how-do-i-use-a-data-type-with-a-url-member-with-serde

@jdm
Copy link
Member

jdm commented Jun 6, 2019

Actually, I guess it's not explicit. You should be able to write A(#[serde(with = "url_serde")] Url, OtherType), I think?

@bestouff
Copy link
Contributor Author

bestouff commented Jun 7, 2019

Thanks. How about adding #502 to help a bit more ?

@nox
Copy link
Contributor

nox commented Jul 18, 2019

url_serde is gone now, you'll be able to use serde 1.0 in url 2.0.

@nox nox closed this as completed Jul 18, 2019
@bestouff
Copy link
Contributor Author

Thanks !

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

No branches or pull requests

3 participants