-
Notifications
You must be signed in to change notification settings - Fork 279
Closed
Labels
Description
Description of the problem
The DomJudge API documentation contains an incorrect execution link, which results in a failed request when using the "Try it out" feature.
Your environment
- DOMjudge version: Latest
- Operating system: Ubuntu 24.04
- Webserver: Apache
- Configuration: Default configuration (based on the docker-compose file)
Steps to reproduce
- Go to the DomJudge API documentation.
- Click on "Try it out" for any endpoint and provide the necessary options.
- Press the "Execute" button.
Expected behaviour
The API request should successfully execute with the correct URL, e.g., http://localhost/api/v4/contests/...
.
Actual behaviour
The API request fails with the following error message:
Code: Undocumented
Details: Failed to fetch.
Possible Reasons:
- CORS
- Network Failure
- URL scheme must be "http" or "https" for CORS request.
The error occurs because the execution link contains an incorrect double /api/
in the URL (http://localhost//api/api/v4/contests/...
).
Any other information that you want to share?
- This issue applies to all API endpoints in the documentation.
- Since the documentation is running on DomJudge itself, using
localhost
seems appropriate. However, if this needs to be deployed to different environments, it might be better to replacelocalhost
with a placeholder like{baseUrl}
for flexibility. - The issue seems to stem from an extra
/api/
segment in the execution URL. It may be useful to adjust the generated links in the documentation to prevent this duplication.