PagerDuty / go-pagerduty

go client library for PagerDuty v2 API
https://v2.developer.pagerduty.com/docs/rest-api
Apache License 2.0
287 stars 241 forks source link

Fix the formatting of the ResponderRequest input and output #442

Closed CerealBoy closed 2 years ago

CerealBoy commented 2 years ago

The documentation has 2 different ways to structure this code, where the doc and the example are different. Previously the code here had worked with the doc formatting, however this is currently not working as intended.

The main change here is within the responder_request_targets portion of the payload, where the array content is an object that then contains a key responder_request_target with the actual object, rather than just this object itself. i.e. It's nested one key deeper in the tree. Originally I'd thought this was different for the input and the output, turns out the only difference is that the incident_responders is not provided in the input, and populated in the output.

This PR also includes the 3 line change to update the go.* files as this was tested on an M1 mac, so a newer version of the golang.org/x/sys library is needed that supports arm64.

ChuckCrawford commented 2 years ago

Apologies for not getting to this earlier but it looks like we have resolved these issues as part of https://github.com/PagerDuty/go-pagerduty/pull/452 and https://github.com/PagerDuty/go-pagerduty/pull/434.

Feel free to reopen this if there are still issues in this area.