-
Notifications
You must be signed in to change notification settings - Fork 240
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
EscalationRule struct should accept a slice of APIReference rather then APIObject for Targets #316
Comments
@gerardocorea your example snippet seems to omit some things. Which method(s) did you call with which input? I'm not fully grokking what's amiss here. I'm not sure the title is correct at a minimum, as the PagerDuty API reference you linked shows that |
@theckman the issue I see is that When trying to create the escalationPolicy I did the following below.
Which resulted in the error below
unless I appended to the
Im wondering now if instead its simply an unmarshal issue or if the type is not being sent in the response correctly which wouldnt be something we would likely address here. Hopefully that clears it up a bit. |
@gerardocorea I'm pretty sure that's what you have to do, unfortunately. Based on their API documentation, and how we've defined the type, it should be populated with the value |
Ah I see now, it's probably a similar issue as #218. There are two |
To be clear, once fixed this will avoid the field being unset. You will still probably have to update it to be a |
Noted. If you think its fine to close this issue then we can. |
I'm going to keep it open until we merge a PR to address it. I should start to work on v1.5.0 once all of the v1.4.0 open items are addressed. Ideally within the coming weeks... |
While attempting to configure an escalation policy I continued to receive the following error below.
upon further research in the api documentation it shows that the fields
Targets
expects an array of targets with anid
andtype
being required.type
should be set touser_reference
https://developer.pagerduty.com/api-reference/reference/REST/openapiv3.json/paths/~1escalation_policies/post
The
GetUser
method returns a User struct with anAPIObject
struct. Thetype
field not populated in theGetUser
response which results in this field being omitted in the post call for an escalation policy.Example post call below. As you can see a value of APIObject in the
targets
array is missing thetype
field.Manually assigning the
Type
field results in the successful creation of the escalation policyThe text was updated successfully, but these errors were encountered: