Executes the wrong endpoint if additional path parameters are provided

I have 2 endpoints:

  1. http://localhost:3000/cameras/{id}

  2. http://localhost:3000/cameras

Issue:
If I call endpoint (1) without passing a value for id, the response returned is actually from endpoint (2).

Expectation:
I still want to call endpoint (1) to test the case where id is required.

I know if I don’t provide an ID value, the endpoint will be http://localhost:3000/cameras/.
But in this case, I want to check that the ID is required and must be a UUID

Based on your use case, here are 4 key test scenarios to design:

  1. Provide a valid UUID as the id parameter (positive test case)
  2. Provide an invalid UUID format to verify non-compliant id values
  3. Include the id parameter but leave its value empty (matches your endpoint1 case)
  4. Omit the id parameter completely (matches your endpoint2 case)

Thank you for your scenarios.
However, I think that a bit inconvenient to manually leave the ID value empty. Could you consider handling the case where, if no ID is provided, it automatically uses a blank value so that it will always call the /camera/{id} API?

Hiếu Trần Your API design conforms to REST standards, where /cameras means listing all cameras, and /cameras/{id} means querying a specific camera by id.

When the value of id is empty, a request to /cameras/{id} should return no data found, rather than returning the response of the /cameras endpoint.

However, in reality, the /cameras/{id} returns the response of the /cameras endpoint. We believe this is an error of the API you are requesting, and you have found out this error. Apidog is working properly.

As a comparison, you can try GitHub’s API. For example:
Using Apidog to request https://api.github.com/repos/{owner}/{repo}/branches/{branch_name} (please pass your Github Token as Bearer Token). If the value of branch_name is left empty, the API will return Branch not found, rather than listing all your branches. The performance of the Github API is correct.