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

Fix some mismatches between REST API and struct definitions #396

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

theckman
Copy link
Collaborator

This change includes the first few fixes while reviewing the repo for #389, and
does include one breaking change.

In change_events.go, there were a few optional fields that were not set to
omitempty, which means we were rendering them in the JSON even when not set.
This also reorders the ChangeEventPayload so that the Summary field is at
the top, since it's the only required field.

In escalation_policy.go, the EscalationPolicy type looked to have a field on
it that indicated if repeating the notification rules was enabled. However, this
field is not documented and when looking at the actual API response no such
field was present. Instead, the field to indicate the number of loops is set to
0 when there is no repeating of the rules.

The removal of this field is the breaking change, although hopefully nobody was
using it. :)

Updates #389

This change includes the first few fixes while reviewing the repo for #389, and
does include one breaking change.

In `change_events.go`, there were a few optional fields that were not set to
`omitempty`, which means we were rendering them in the JSON even when not set.
This also reorders the `ChangeEventPayload` so that the `Summary` field is at
the top, since it's the only required field.

In `escalation_policy.go`, the `EscalationPolicy` type looked to have a field on
it that indicated if repeating the notification rules was enabled. However, this
field is not documented and when looking at the actual API response no such
field was present. Instead, the field to indicate the number of loops is set to
`0` when there is no repeating of the rules.

The removal of this field is the breaking change, although hopefully nobody was
using it. :)

Updates #389
@theckman theckman added this to the v1.5.0 milestone Nov 16, 2021
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.

If the RepeatEnabled field didn't do anything anyways I wouldn't think folks were using it. Thanks for cleaning up these fields! 👍

@theckman theckman added the breaking change This PR contains a breaking change label Nov 17, 2021
@theckman theckman merged commit 12152a7 into master Nov 17, 2021
@theckman theckman deleted the issue_389-0 branch November 17, 2021 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This PR contains a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants