Skip to content

Commit

Permalink
Merge pull request ppy#11372 from nanaya/remove-key-option
Browse files Browse the repository at this point in the history
Deprecate key option for Get User endpoint
  • Loading branch information
notbakaneko authored Jul 30, 2024
2 parents 4481337 + da665df commit 1de921d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,10 @@ public function me($mode = null)
* - support_level
* - user_achievements
*
* @urlParam user integer required Id or username of the user. Id lookup is prioritised unless `key` parameter is specified. Previous usernames are also checked in some cases. Example: 1
* @urlParam user integer required Id or `@`-prefixed username of the user. Previous usernames are also checked in some cases. Example: 1
* @urlParam mode string [Ruleset](#ruleset). User default mode will be used if not specified. Example: osu
*
* @queryParam key Type of `user` passed in url parameter. Can be either `id` or `username` to limit lookup by their respective type. Passing empty or invalid value will result in id lookup followed by username lookup if not found.
* @queryParam key Type of `user` passed in url parameter. Can be either `id` or `username` to limit lookup by their respective type. Passing empty or invalid value will result in id lookup followed by username lookup if not found. This parameter has been deprecated. Prefix `user` parameter with `@` instead to lookup by username.
*
* @response "See User object section"
*/
Expand Down
1 change: 1 addition & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ public static function lookupWithHistory($usernameOrId, $type = null, $findAll =
}

// don't perform username change history lookup if we're searching by ID
// TODO: remove this parameter and always rely on `@` prefix or digit check.
if ($type === 'id') {
return null;
}
Expand Down
3 changes: 3 additions & 0 deletions resources/views/docs/info.md.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

## Breaking Changes

### 2024-07-30
- `key` parameter for Get User endpoint has been deprecated. Prefix username with `@` to lookup by username instead.

### 2024-01-23
- `active_tournament_banner` in [User](#user) has been deprecated, use `active_tournament_banners` instead.

Expand Down

0 comments on commit 1de921d

Please sign in to comment.