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

Missing enum in schema for `VariantKey`: `fromPosition` #181

Closed mcognetta closed 2 years ago

mcognetta commented 2 years ago

The game variant enum, VariantKey (definition), has an undocumented value fromPosition. For example, exporting this game, which was started from specific FEN, returns a JSON with "variant": "fromPosition".

This enum value is not mentioned in the Lichess API docs: https://lichess.org/api#operation/gamePgn.

mcognetta commented 2 years ago

On this note, it seems like fromPosition doesn't fit well into this enum, as it doesn't tell you what the game type is. Perhaps it can moved out to a boolean? I don't think it can be removed entirely (like implicitly defined by the presence of a non-starting board initial position FEN), since maybe the Chess960 response will include such a FEN.

niklasf commented 2 years ago

Good catch. By (unfortunate) design, custom starting positions in standard chess are a variant called fromPosition, and so variants do not support custom starting positions.