Skip to content

AlertSettings field of Check struct should be a pointer value #13

Open
@devilleweppenaar

Description

@devilleweppenaar

The AlertSettings field of the Check struct is currently a struct. The result is that when this field is omitted, the resulting JSON still contains the value. This is not what the API expects or what is documented in the API docs.

This can be see here: https://play.golang.org/p/cupZglCunSx
Which prints:

{"alertSettings":{"runBasedEscalation":{},"timeBasedEscalation":{},"reminders":{},"sslCertificates":{"enabled":false,"alertThreshold":0}}}

If you were to change the AlertSettings field to a pointer type, the resulting JSON will be what's expected.

This can be seen here: https://play.golang.org/p/YbWYjwaW3RU
Which prints:

{}

This is also true for the subfields of AlertSettings:

  • RunBasedEscalation
  • TimeBasedEscalation
  • Reminders
  • SSLCertificates

Metadata

Metadata

Assignees

Labels

type: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions