Closed displague closed 2 years ago
@displague we could check if the ID is a valid UUID. And wrap the check in a function so that it can be easily changed.
Some users of this client may have tests with http.Client
mocks and invalid IDs like foo
. Those tests will need to be modified to use either change the validator or change the mock ID.
It is possible to send ID="" to various service methods, such as Devices.Delete.
The client will send
DELETE /metal/v1/devices/
. This should not be permitted as such an API call could have unexpected consequences (deleting all devices, for example - although that is not the case).When an ID is required but an empty ID is provided, the client call should fail with a consistent error message. This should not be left to a 404 response from the API server.