lichess-org / api

Lichess API documentation and examples
https://lichess.org/api
GNU Affero General Public License v3.0
417 stars 140 forks source link

`/account/preferences` soundSet enum returns an upper-case value instead of a lower-case one as the doc states, for first-time accounts #233

Closed alexrintt closed 1 year ago

alexrintt commented 1 year ago

https://lichess.org/api#tag/Account/operation/account.

How to reproduce

  1. Create a new Lichess account.
  2. Verify your email address.
  3. Create a personal access token with read access to your preferences.
  4. Call curl --request GET --url https://lichess.org/api/account/preferences --header "Authorization: Bearer <your-personal-access-token-here>".
  5. See prefs.soundSet key.
  6. You'll see the key set as "Standard", not as "standard" as the documentation states (see below).

If you update your preference to some other soundKey enum option and set again to "standard", you will see that the enum key will be fixed.

Note: use this token: lip_cgTTCykZg0App0jTJa9o to test the 3. step without needing to create a new acc, it has preferences:read scope.


From: https://lichess.org/api#tag/Account/operation/account:

soundSet is a string enum: "silent" "standard" "piano" "nes" "sfx" "futuristic" "robot" "music" "speech".

image


Tried to find the controller that is causing this issue, but I don't know Scala, so I could only try to understand the semantics of the code:

niklasf commented 1 year ago

Thanks for reporting. The inconsistency will be fixed with the next update.