mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[GH-ISSUE #392] Can't turn a Token to a serde_json::value::Value and back #126
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @PaulOlteanu on GitHub (Mar 8, 2023).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/392
Describe the bug
Trying to create a
Tokenfrom aserde_json::value::Valueresults in an errorinvalid type string expected a borrowed string.To Reproduce
Steps to reproduce the behavior:
Token/get a token from a clientValuefrom this token (let value = json!(token))let token = serde_json::from_value(value))Expected behavior
A
Tokenshould be able to be created from aValueAdditional context
The issue seems to come from the deserialization portion of
space_separated_scopes. Changinggithub.com/ramsayleung/rspotify@6d304de632/rspotify-model/src/custom_serde.rs (L225)to be
let scopes: String = Deserialize::deserialize(d)?;fixes the issue, but I'm not familiar enough with how serde deserialization works to judge if this is a good solution
@ramsayleung commented on GitHub (Apr 10, 2023):
I can reproduce this bug with this following test case:
I have created a PR to fix this problem.
@ramsayleung commented on GitHub (May 22, 2023):
This problem has been fixed.