go-pagerduty icon indicating copy to clipboard operation
go-pagerduty copied to clipboard

Research updating some fields to use APIObject type instead of full objects

Open theckman opened this issue 4 years ago • 3 comments

There are some PagerDuty REST API endpoints that return API object references instead of the full objects for specific keys, to avoid sending massive amounts of (potentially unused) JSON across the wire.

Refer to this comment on a PR where a change was required to use APIObject instead, because it was the shape expected by the PagerDuty API: https://github.com/PagerDuty/go-pagerduty/pull/273#discussion_r579711069.

The reason I think we should investigate changing this, is because per our documentation some users may expect to see a full object sent back (see #250). This would be a v2.0.0 change.

theckman avatar Feb 20 '21 22:02 theckman

Another example: https://github.com/PagerDuty/go-pagerduty/blob/e23b94cea01f37da371fd9d7efb4e20ea0e36ff2/webhook.go#L32

theckman avatar May 16 '21 07:05 theckman

https://github.com/PagerDuty/go-pagerduty/blob/da97010e7f22b22d88b2a9e4b0eb6e7c4566721f/incident.go#L80

https://github.com/PagerDuty/go-pagerduty/blob/da97010e7f22b22d88b2a9e4b0eb6e7c4566721f/incident.go#L60-L64

https://developer.pagerduty.com/api-reference/b3A6Mjc0ODE0MQ-get-an-incident

theckman avatar Nov 06 '21 08:11 theckman

https://github.com/PagerDuty/go-pagerduty/blob/77a73c9d16987b91549d60d76d5a075e91400df9/on_call.go#L11-L13

theckman avatar Jan 16 '22 06:01 theckman