PagerDuty/go-pagerduty

Improper unmarshalling

Erog38 opened this issue · 3 comments

// ResponderRequestTarget specifies an individual target for the responder request.

Use of this field doesn't unmarshal properly and causes the sdk to not allow adding responders to an event.

https://play.golang.org/p/uDs91_9GXDG

In fact, I think just adding an s to this line would fix it.

Targets []ResponderRequestTarget `json:"responder_request_targets"`

So it should be

Targets     []ResponderRequestTargets `json:"responder_request_targets"`

and not

Targets     []ResponderRequestTarget `json:"responder_request_targets"`

Thanks for pointing this out! Would you mind submitting a PR for the fix?

Sure thing @stmcallister ! I opened #233 for review to fix this and a couple other spots. I wasn't sure you watched this repo, I assumed most of this code was generated from the openapi spec or similar.