-
Notifications
You must be signed in to change notification settings - Fork 6
Option to serialize Vec<T> into comma-separated list #13
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
Comments
Do you an example of how it should be used with an expected output? We could make it directly into a test and implement it. |
Here's an example where I wanted to use this crate for generating an OAuth url for Google Calendars: #[derive(Serialize)]
pub(crate) struct AuthorizationParameters<'a> {
...
scope: Vec<&'a str>,
...
} Actual
Needed
|
I added an example in #14. Does it solve you problem? |
Sorry for the delay, I was enjoying the rest of my holidays. In my quick tinkering, I failed to implement this for my use case. After looking at it again at a later time, I noticed the usage of the Itertools crate. Seems like the Either way, with your guidance on how to operate the serde crate in this example, I think I can either replicate the behaviour with some custom implementation or I consider using Itertools. Thanks! Not sure if I should close this issue now or if you want to link-close it with #14. |
This would be nice for APIs that require a comma-separated list for authorization scopes.
I was looking into the source code myself, but I only have limited knowledge of the inner workings of
serde
. Not sure where a Vec is being iterated in the customSerializer
of this crate.The text was updated successfully, but these errors were encountered: