diff --git a/models/compat/wakatime/v1/stats.go b/models/compat/wakatime/v1/stats.go index 428b1db..5cdc449 100644 --- a/models/compat/wakatime/v1/stats.go +++ b/models/compat/wakatime/v1/stats.go @@ -26,7 +26,7 @@ type StatsData struct { Machines []*SummariesEntry `json:"machines"` Projects []*SummariesEntry `json:"projects"` OperatingSystems []*SummariesEntry `json:"operating_systems"` - Branches []*SummariesEntry `json:"branches"` + Branches []*SummariesEntry `json:"branches,omitempty"` } func NewStatsFrom(summary *models.Summary, filters *models.Filters) *StatsViewModel { diff --git a/models/compat/wakatime/v1/summaries.go b/models/compat/wakatime/v1/summaries.go index e8220a6..eefd6c0 100644 --- a/models/compat/wakatime/v1/summaries.go +++ b/models/compat/wakatime/v1/summaries.go @@ -26,7 +26,7 @@ type SummariesData struct { Machines []*SummariesEntry `json:"machines"` OperatingSystems []*SummariesEntry `json:"operating_systems"` Projects []*SummariesEntry `json:"projects"` - Branches []*SummariesEntry `json:"branches"` + Branches []*SummariesEntry `json:"branches,omitempty"` GrandTotal *SummariesGrandTotal `json:"grand_total"` Range *SummariesRange `json:"range"` } diff --git a/testing/Wakapi API Tests.postman_collection.json b/testing/Wakapi API Tests.postman_collection.json index 8bd1adb..98f93d6 100644 --- a/testing/Wakapi API Tests.postman_collection.json +++ b/testing/Wakapi API Tests.postman_collection.json @@ -2080,7 +2080,7 @@ " const jsonData = pm.response.json();", " pm.expect(jsonData.data.languages).to.eql(null); // because share_languages is false", " pm.expect(jsonData.data.projects.length).to.eql(1);", - " pm.expect(jsonData.data.branches).to.be.null;", + " pm.expect(jsonData.data.branches).to.be.undefined;", "});" ], "type": "text/javascript"