[GH-ISSUE #414] Uri enum #138

Closed
opened 2026-02-27 20:23:20 +03:00 by kerem · 5 comments
Owner

Originally created by @blueforesticarus on GitHub (May 25, 2023).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/414

Is your feature request related to a problem? Please describe.
I am making a cli for testing parts of my application and want to pass a spotify uri as an arg. A way to parse this as a valid spotify uri, then match on it, would be useful. It would also serve as a useful type for parts of my application which are generic over Album, Playlist, or Track, of which there are many.

Describe the solution you'd like
It would be convenient to have an Uri enum covering all the Id types, so we can always parse a uri, and match over the various ids.

Describe alternatives you've considered
Manually calling parse_uri and matching over the result.
Alternatively Uri could be a struct with id and type. Though I think this is maybe more cumbersome for matching.

Originally created by @blueforesticarus on GitHub (May 25, 2023). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/414 **Is your feature request related to a problem? Please describe.** I am making a cli for testing parts of my application and want to pass a spotify uri as an arg. A way to parse this as a valid spotify uri, then match on it, would be useful. It would also serve as a useful type for parts of my application which are generic over Album, Playlist, or Track, of which there are many. **Describe the solution you'd like** It would be convenient to have an Uri enum covering all the Id types, so we can always parse a uri, and match over the various ids. **Describe alternatives you've considered** Manually calling parse_uri and matching over the result. Alternatively Uri could be a struct with id and type. Though I think this is maybe more cumbersome for matching.
kerem 2026-02-27 20:23:20 +03:00
Author
Owner

@ramsayleung commented on GitHub (May 25, 2023):

Please follow the issue template to describe your problem with context information, it would be helpful for others to understand your issue.

<!-- gh-comment-id:1563315049 --> @ramsayleung commented on GitHub (May 25, 2023): Please follow the issue template to describe your problem with context information, it would be helpful for others to understand your issue.
Author
Owner

@blueforesticarus commented on GitHub (May 26, 2023):

I think this is a sufficient implementation for what I am talking about (if you agree it is desirable). Although someone may have suggestions.

Someone could argue that Uri should be a struct with id and type, perhaps with another type for the enum.

<!-- gh-comment-id:1563850870 --> @blueforesticarus commented on GitHub (May 26, 2023): I think this is a sufficient implementation for what I am talking about (if you agree it is desirable). Although someone may have suggestions. Someone could argue that Uri should be a struct with id and type, perhaps with another type for the enum.
Author
Owner

@ramsayleung commented on GitHub (Jun 7, 2023):

I think it makes sense to me, feel free to create a PR :)

<!-- gh-comment-id:1581251071 --> @ramsayleung commented on GitHub (Jun 7, 2023): I think it makes sense to me, feel free to create a PR :)
Author
Owner

@github-actions[bot] commented on GitHub (Dec 5, 2023):

Message to comment on stale issues. If none provided, will not mark issues stale

<!-- gh-comment-id:1839878697 --> @github-actions[bot] commented on GitHub (Dec 5, 2023): Message to comment on stale issues. If none provided, will not mark issues stale
Author
Owner

@github-actions[bot] commented on GitHub (Nov 28, 2025):

Message to comment on stale issues. If none provided, will not mark issues stale

<!-- gh-comment-id:3587752551 --> @github-actions[bot] commented on GitHub (Nov 28, 2025): Message to comment on stale issues. If none provided, will not mark issues stale
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#138
No description provided.