I have 2 endpoints:
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 have 2 endpoints:
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:
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.