checkly-go-sdk icon indicating copy to clipboard operation
checkly-go-sdk copied to clipboard

AlertSettings field of Check struct should be a pointer value

Open devilleweppenaar opened this issue 4 years ago • 0 comments

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

devilleweppenaar avatar Nov 26 '20 16:11 devilleweppenaar