Skip to content

Commit

Permalink
add omitempty to optional slices; fixes checkly#14
Browse files Browse the repository at this point in the history
  • Loading branch information
devilleweppenaar committed Nov 26, 2020
1 parent 1f2cb70 commit d4f88d9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ type Check struct {
Activated bool `json:"activated"`
Muted bool `json:"muted"`
ShouldFail bool `json:"shouldFail"`
Locations []string `json:"locations"`
Locations []string `json:"locations,omitempty"`
DegradedResponseTime int `json:"degradedResponseTime"`
MaxResponseTime int `json:"maxResponseTime"`
Script string `json:"script,omitempty"`
EnvironmentVariables []EnvironmentVariable `json:"environmentVariables"`
EnvironmentVariables []EnvironmentVariable `json:"environmentVariables,omitempty"`
DoubleCheck bool `json:"doubleCheck"`
Tags []string `json:"tags"`
Tags []string `json:"tags,omitempty"`
SSLCheck bool `json:"sslCheck"`
SetupSnippetID int64 `json:"setupSnippetId,omitempty"`
TearDownSnippetID int64 `json:"tearDownSnippetId,omitempty"`
Expand All @@ -114,9 +114,9 @@ type Request struct {
FollowRedirects bool `json:"followRedirects"`
Body string `json:"body"`
BodyType string `json:"bodyType,omitempty"`
Headers []KeyValue `json:"headers"`
QueryParameters []KeyValue `json:"queryParameters"`
Assertions []Assertion `json:"assertions"`
Headers []KeyValue `json:"headers,omitempty"`
QueryParameters []KeyValue `json:"queryParameters,omitempty"`
Assertions []Assertion `json:"assertions,omitempty"`
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
}

Expand Down Expand Up @@ -214,11 +214,11 @@ type Group struct {
Name string `json:"name"`
Activated bool `json:"activated"`
Muted bool `json:"muted"`
Tags []string `json:"tags"`
Locations []string `json:"locations"`
Tags []string `json:"tags,omitempty"`
Locations []string `json:"locations,omitempty"`
Concurrency int `json:"concurrency"`
APICheckDefaults APICheckDefaults `json:"apiCheckDefaults"`
EnvironmentVariables []EnvironmentVariable `json:"environmentVariables"`
EnvironmentVariables []EnvironmentVariable `json:"environmentVariables,omitempty"`
DoubleCheck bool `json:"doubleCheck"`
UseGlobalAlertSettings bool `json:"useGlobalAlertSettings"`
AlertSettings AlertSettings `json:"alertSettings,omitempty"`
Expand Down

0 comments on commit d4f88d9

Please sign in to comment.