Achievement type (Missable/Progression/WinCondition) always deserializes to null
#49
Unanswered
RobZombie9043
asked this question in
Q&A
Replies: 2 comments
|
Confirming both findings against the live API and the codebase — your diagnosis is exactly right, and they're independently fixable:
Workaround until both land, if you need |
0 replies
|
Either of your Claudes are welcome to open a PR with a fix. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Achievement.typecomes backnullon every achievement, for every game, through both endpoints that expose it —GetGameInfoAndUserProgressandGetGameExtended— but for two different reasons. Confirmed on2.0.0(also present onmainas of this writing).Bug 1:
GetGameInfoAndUserProgress.Response.Achievement.typeThe live
API_GetGameInfoAndUserProgress.phpresponse does not include atypekey on achievement objects at all, regardless of thea(includeUserAward) parameter. Every other field in this class deserializes correctly; onlytypeis consistently absent/null.Bug 2:
GetGameExtended.Response.Achievement.typeThis one's the opposite problem: the live
API_GetGameExtended.phpresponse does include the data, but under a lowercasetypekey, notType. Since Gson's field matching is case-sensitive, this annotation never matches and the field deserializes tonulleven though the data is present.Confirmed via a raw (unparsed) response body for a classified achievement:
i.e. the key genuinely is lowercase
typein the live payload, matching whatGetGameInfoAndUserProgress's class already (correctly, per Bug 1's evidence) expects —GetGameExtended's annotation is the one that's wrong.Suggested fix
GetGameInfoAndUserProgress.Response.Achievement.type: investigate whether this endpoint can returntypeat all (perhaps behind a different/undocumented parameter), or document that it never does.GetGameExtended.Response.Achievement.type: change@SerializedName("Type")to@SerializedName("type")to match the live API.Repro
Any authenticated
getGameExtended(gameId)call for a game with at least one classified achievement (e.g. a Missable-tagged achievement) will showtype == nullon that achievement in the deserialized response, despite the RA website and the raw JSON both showing a real classification.P.S. raised this as a Q&A as the Issues workflow to Report a bug is not working.
All reactions