chore: remove trailing slash from API base URL #464
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
packngo
SDK assumed that the base API URL did not end with a slash, butequinix-sdk-go
assumes that it does (since it's generated from an OpenAPI spec, all API paths inequinix-sdk-go
start with a slash). A trailing slash on the base API URL doesn't cause problems forequinix-sdk-go
, but it can cause confusion when triaging issues.This removes the trailing slash from the 2 places where we are configuring the base API URL. We can do this safely now because we no longer use
packngo
. Alternatively, we could make the base API URL configuration optional; the API URL configured here is identical to the default used by themetalv1
package inequinix-sdk-go
, so we only really need to change the API URL for tests that use a mock API. That change would be more extensive so I opted for the smallest change instead.