lichess-org / api

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

Add missing `standard` and `puzzle` perf types to API spec #184

Closed mcognetta closed 2 years ago

mcognetta commented 2 years ago

See https://github.com/lichess-org/lila/blob/master/modules/rating/src/main/PerfType.scala#L170

benediktwerner commented 2 years ago

I don't think those are returned by the API anywhere, are they?

mcognetta commented 2 years ago

I should have put an example in the original PR, my apologies.

standard can indeed be returned by the API. For example, if you export a game that was imported from PGN without sufficient specification. See, for example, this game: https://lichess.org/d9K1VFiY which returns a JSON like:

  "createdAt" => 1444764735151
  "variant"   => "standard"
  "status"    => "started"
  ⋮           => ⋮

I don't believe puzzle is returned anywhere at this time. I included it for completeness, but maybe it is better to remove it.

benediktwerner commented 2 years ago

That's a different schema though: https://github.com/lichess-org/api/blob/master/doc/specs/lichess-api.yaml#L863 https://github.com/lichess-org/api/blob/master/doc/specs/lichess-api.yaml#L6954 https://github.com/lichess-org/api/blob/master/doc/specs/lichess-api.yaml#L6622

The PerfType schema only seems to be used for the filter parameter when requesting games and standard isn't a valid value there.

mcognetta commented 2 years ago

Oh, I see. I misunderstood the schema then. Thanks for clearing that up, I will close this now.