bjedrzejewski / chessmates

Statistics for your Lichess team
1 stars 3 forks source link

Adds league table endpoint #48

Closed janakerman closed 7 years ago

janakerman commented 7 years ago

Resolves #49

Note that in the league table I'm 'unsafely' accessing properties on an object. However, since the GameColor enum fromString method returns an optional we're checking and logging as we might as well.

I'm trying not to be too defensive while programming here, we should assume that once we're handling game data that's been downloaded, it should be safe, so we shouldn't null check everything.

I'll add to our item validator in the following commit so we can be sure that we are dealing with safe objects internally.

Opinions on this wanted!

janakerman commented 7 years ago

@bjedrzejewski - opinions on the rest endpoint? I'm considering changing it to: table/league

If we treat a table as a resource, with the potential for there to be multiple tables in the future: table/cross

Thoughts?