DOMjudge/domjudge

Mistypings in the API docs - "/api/v4/contests".

hoony9x opened this issue ยท 5 comments

Description of the problem

Mistypings (and ambiguous descriptions) at 'Contests' API.

Your environment

  • DOMjudge version 7.1.0 DEV

Steps to reproduce

Expected behaviour

For example, let's try "/api/v4/contests/{cid}/clarifications".
In the admin panel, {cid} is an unique integer.
If I type any {cid}, it should produce list of clarifications.

Actual behaviour

404 not found.

Any other information that you want to share?

In admin panel, {cid} is an unique integer.
However, in the api doc, {cid} actually means 'external ID' in the admin panel.
At first time, I was really confused because I just typed {cid} (which is a unique integer in the admin panel) but it produces 404 not found.

Moreover, there is an api '/api/v4/contests/{id}'.
In this api, {id} means 'external ID' too!

I think {cid} and {id} should be changed to {external_id}
or
{cid} should be matched to actual cid in the admin panel. (and {id} too)

This depends on what you set the data source configuration option to. If you set it to 0 (default) it will be the id from the admin interface. If you set it to 1 or 2 it will instead be the external id instead. Reason for this is to by default indeed make it easy but give us the option to adhere to the official contest spec.

I will see if we can easily change the id in the base contest endpoint to also be cid

Ah to add: demo web runs with data source 1 because that is what was used during the nwerc

Thanks.

One more thing, can you tell me how to set the data source config opt?

Oh, I just find this setting at the configuration panel. Thanks.

We might want to improve the documentation for the api, explaining this option