fix(model): change ranked field from u32 to i32 to support negative status values #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The osu! API documentation specification for the ranked field (Beatmapset Rank Status) includes negative integer values:
-2: graveyard-1: wip0: pending1: ranked2: approved3: qualified4: lovedThe current implementation defines it as a
u32, which used to cause deserialization errors (invalid value: integer -2, expected u32) when fetching beatmaps with "graveyard" or "wip" status.This PR fixes the issue by changing the field type to
i32. I've ran tests locally for this change that now allowed me to fetch certain maps it didn't successfully fetch before.📋 Types of Changes
Related Issue
None
Checklist
There weren't any existing tests so not sure where I would put them. I can provide my current test if requested. The map ID I tested with was 180708