Removed the integer condition code from the output at the conditions/current endpoint
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-03-17 19:35:40 -05:00
parent 8711fc457c
commit 4b97a4c062
2 changed files with 6 additions and 7 deletions

View File

@@ -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")
}

View File

@@ -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"`
}