Summary
EmissionsDataDto.Value is declared as float64 with json:"value,omitempty". In Go, omitempty on a numeric type omits the field when it equals the zero value (0.0). When a data provider returns 0.0 (e.g. during a WattTime outage), the field is silently dropped from the ConfigMap's binary data field.
Consumers reading the ConfigMap cannot distinguish "missing data" from a legitimate zero-intensity reading.
Steps to reproduce
- WattTime returns
value: 0.0 from /v3/forecast
- Carbon Aware SDK passes it through unchanged
- The Go client decodes
0.0 into Value float64
- On re-encode with
omitempty, the value key is absent from the ConfigMap binary data
{ "location": "CAISO_NORTH", "timestamp": "2026-04-23T16:25:00Z", "duration": 5 }
The value field is missing entirely rather than being 0 or null.
Suggested fix
Change Value float64 to Value *float64 in pkg/sdk/client/model_emissions_data_dto.go so that null (truly missing) is distinguishable from 0.0. Note: this file is swagger-generated — the same fix should be proposed upstream to the Carbon Aware SDK.
Summary
EmissionsDataDto.Valueis declared asfloat64withjson:"value,omitempty". In Go,omitemptyon a numeric type omits the field when it equals the zero value (0.0). When a data provider returns0.0(e.g. during a WattTime outage), the field is silently dropped from the ConfigMap's binarydatafield.Consumers reading the ConfigMap cannot distinguish "missing data" from a legitimate zero-intensity reading.
Steps to reproduce
value: 0.0from/v3/forecast0.0intoValue float64omitempty, thevaluekey is absent from the ConfigMap binary data{ "location": "CAISO_NORTH", "timestamp": "2026-04-23T16:25:00Z", "duration": 5 }The
valuefield is missing entirely rather than being0ornull.Suggested fix
Change
Value float64toValue *float64inpkg/sdk/client/model_emissions_data_dto.goso thatnull(truly missing) is distinguishable from0.0. Note: this file is swagger-generated — the same fix should be proposed upstream to the Carbon Aware SDK.