mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #531] [MERGED] [feat] Add fallback variant to capture unknown variant #515
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#515
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?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/531
Author: @ramsayleung
Created: 7/7/2025
Status: ✅ Merged
Merged: 7/7/2025
Merged by: @ramsayleung
Base:
master← Head:ramsay/allow-enum-unknown-variant📝 Commits (6)
af30dd9[feat]Add fallback variant to capture unknown variantbfbeabbAdd unit test for fallback variantafa3623Fix cargo fmt error3e21d84Fix cargo clippy error8a6475fFix clippy error again39aa84eFix cargo clippy error📊 Changes
6 files changed (+26 additions, -6 deletions)
View changed files
📝
examples/webapp/src/main.rs(+1 -1)📝
rspotify-http/src/reqwest.rs(+1 -1)📝
rspotify-http/src/ureq.rs(+1 -1)📝
rspotify-model/src/custom_serde.rs(+1 -2)📝
rspotify-model/src/enums/types.rs(+5 -1)📝
tests/test_models.rs(+17 -0)📄 Description
To prevent
RSpotifyfrom raising a deserialization error whenever Spotify adds new variant typeDescription
Whenever Spotify introduces a new type, this library will fail to deserialize the JSON, as it couldn't find the matched variant for the newly added type.
Add a fallback variant to capture this new type to prevent us from raising JSON parse error
Motivation and Context
#525
Dependencies
None
Type of change
Please delete options that are not relevant.
How has this been tested?
test_fallback_variant_type_to_capture_new_type: passedIs this change properly documented?
It's unnecessary
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.