Skip to content
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

business_service: clean b.ID before calling UPDATE #253

Merged
merged 2 commits into from Dec 11, 2020

Conversation

GiedriusS
Copy link
Contributor

@GiedriusS GiedriusS commented Dec 2, 2020

PUT /business_services/{id} doesn't accept ID in the body:
https://developer.pagerduty.com/api-reference/reference/REST/openapiv3.json/paths/~1business_services~1%7Bid%7D/put

However, specifying it for the go-pagerduty to work is mandatory.
Thus, it is impossible to use this method ATM without this fix. Let's
clear b.ID before calling PUT and store it in a separate variable.

Testing: my code calling this method works again with these changes.
Otherwise, the following error is spotted:

Failed call API endpoint. HTTP response code: 400. Error: \u0026{400 Invalid input [The field id is invalid.]}

I have added a small test case to the suite. LMK if this looks good.

PUT `/business_services/{id}` doesn't accept `ID` in the body:
https://developer.pagerduty.com/api-reference/reference/REST/openapiv3.json/paths/~1business_services~1%7Bid%7D/put

However, specifying it for the `go-pagerduty` to work is mandatory.
Thus, it is impossible to use this method ATM without this fix. Let's
clear `b.ID` before calling `PUT` and store it in a separate variable.

Testing: my code calling this method works again with these changes.
Otherwise, the following error is spotted:
```
Failed call API endpoint. HTTP response code: 400. Error: \u0026{400 Invalid input [The field id is invalid.]}
```
@GiedriusS
Copy link
Contributor Author

@stmcallister could you please look into this?

Copy link
Contributor

@stmcallister stmcallister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks for fixing that!! 🎉

@stmcallister stmcallister merged commit 8618611 into PagerDuty:master Dec 11, 2020
@theckman theckman added this to the v1.4.0 milestone Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants