ppy / osu-web

the browser-facing portion of osu!
https://osu.ppy.sh
GNU Affero General Public License v3.0
983 stars 386 forks source link

If user was deleted, some fields of UserCompact are null unlike the docs. #10538

Open ilsubyeega opened 1 year ago

ilsubyeega commented 1 year ago

Docs: https://osu.ppy.sh/docs/index.html#usercompact Url: /api/v2/beatmapsets/4

// .....
  "user": {
    "avatar_url": null, // <-- This is not nullable from docs
    "country_code": null, // <-- This is not nullable from docs
    "default_group": "default",
    "id": null, // <-- This is not nullable from docs
    "is_active": false,
    "is_bot": false,
    "is_deleted": true,
    "is_online": false,
    "is_supporter": false,
    "last_visit": null,
    "pm_friends_only": false,
    "profile_colour": null,
    "username": "[deleted user]"
  }
// ....
peppy commented 1 year ago

I guess we omit these fields rather than listing as null? Or just provide a null user instead?

notbakaneko commented 1 year ago

They should probably default to the same values as https://github.com/ppy/osu-web/blob/master/resources/js/models/user.ts

Then again, the js side has defaults to make typing assumptions simpler 🤔