Skip to content

Incorrect Execution Link in DomJudge API Documentation #2792

@TrainedPro

Description

@TrainedPro

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

  1. Go to the DomJudge API documentation.
  2. Click on "Try it out" for any endpoint and provide the necessary options.
  3. 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 replace localhost 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions