diff --git a/internal/adapters/httpapi/server_test.go b/internal/adapters/httpapi/server_test.go index 8c5084a..8f462ab 100644 --- a/internal/adapters/httpapi/server_test.go +++ b/internal/adapters/httpapi/server_test.go @@ -140,15 +140,15 @@ func TestConditionsCurrentDefaultsToUSUnits(t *testing.T) { if got := payload["windDirectionDegrees"].(float64); got != 270.0 { t.Fatalf("expected windDirectionDegrees=270.0, got %v", got) } - if got := payload["conditionCode"].(float64); got != 63 { - t.Fatalf("expected conditionCode=63, got %v", got) - } if got := payload["conditionText"].(string); got != "Rain" { t.Fatalf("expected conditionText=Rain, got %v", got) } if got := payload["isDay"].(bool); !got { t.Fatalf("expected isDay=true, got %v", got) } + if _, exists := payload["conditionCode"]; exists { + t.Fatalf("did not expect conditionCode in conditions response") + } if _, exists := payload["temperatureC"]; exists { t.Fatalf("did not expect metric key temperatureC in default US response") } @@ -189,15 +189,15 @@ func TestConditionsCurrentSupportsMetricUnits(t *testing.T) { if got := payload["windSpeedKmh"].(float64); got != 10.0 { t.Fatalf("expected windSpeedKmh=10.0, got %v", got) } - if got := payload["conditionCode"].(float64); got != 63 { - t.Fatalf("expected conditionCode=63, got %v", got) - } if got := payload["conditionText"].(string); got != "Rain" { t.Fatalf("expected conditionText=Rain, got %v", got) } if got := payload["isDay"].(bool); got { t.Fatalf("expected isDay=false, got %v", got) } + if _, exists := payload["conditionCode"]; exists { + t.Fatalf("did not expect conditionCode in conditions response") + } if _, exists := payload["temperatureF"]; exists { t.Fatalf("did not expect US key temperatureF in metric response") } diff --git a/internal/application/conditions/service.go b/internal/application/conditions/service.go index e85deb9..8c8fcd3 100644 --- a/internal/application/conditions/service.go +++ b/internal/application/conditions/service.go @@ -33,7 +33,6 @@ type Response struct { WindSpeedKmh *float64 `json:"windSpeedKmh,omitempty"` WindSpeedMph *float64 `json:"windSpeedMph,omitempty"` WindDirectionDegrees *float64 `json:"windDirectionDegrees,omitempty"` - ConditionCode *int `json:"conditionCode,omitempty"` ConditionText *string `json:"conditionText,omitempty"` IsDay *bool `json:"isDay,omitempty"` }