-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't add trailing / in api calls #231
Don't add trailing / in api calls #231
Conversation
Always appending `/` to the resource can cause some POST requests for new resources to fail when using _callAPI / _buildRequestURI.
Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter { | ||
$Uri -eq "https://dev.azure.com/test/test/_apis/wit/workitemtypes/?api-version=$([VSTeamVersions]::Core)" | ||
Assert-MockCalled Invoke-RestMethod -Exactly -Scope It -Times 2 -ParameterFilter { | ||
$Uri -eq "https://dev.azure.com/test/test/_apis/wit/workitemtypes?api-version=$([VSTeamVersions]::Core)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling this test out - the mock was only asserted once before these changes because each call built the URL differently. Now they both build it the same way.
As it turns out, this change did not have an effect on the api call I was trying to use. I've filed a bug report against Azure DevOps. I do think it's a good change however. It's more consistent with the API docs to remove the |
Thanks for the update and support. I will look into merging this PR this week. |
Always appending
/
to the resource can cause some POST requests for new resources to fail when using _callAPI / _buildRequestURI.PR Summary
Fixes #230
PR Checklist
No new help or unit tests to write.