From 543de04a30c96c5f2b0f6bec19fe0560791f44e7 Mon Sep 17 00:00:00 2001 From: Oleg Balunenko Date: Fri, 5 Jun 2026 04:19:02 +0400 Subject: [PATCH] feat: Update elapsed and moving time types to float These values, representing time, can contain fractions of seconds and are better represented as floating-point numbers. This change updates both the OpenAPI specification and the generated Go model for improved precision. --- docs/swagger.json | 6 ++++-- internal/gen/strava-api-go/models/activity_total.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/swagger.json b/docs/swagger.json index a7f2b67..de8b4b5 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2906,7 +2906,8 @@ }, "elapsed_time": { "description": "The total elapsed time of the considered activities.", - "type": "integer" + "type": "number", + "format": "float" }, "elevation_gain": { "description": "The total elevation gain of the considered activities.", @@ -2915,7 +2916,8 @@ }, "moving_time": { "description": "The total moving time of the considered activities.", - "type": "integer" + "type": "number", + "format": "float" } } }, diff --git a/internal/gen/strava-api-go/models/activity_total.go b/internal/gen/strava-api-go/models/activity_total.go index fba11aa..0c3c729 100644 --- a/internal/gen/strava-api-go/models/activity_total.go +++ b/internal/gen/strava-api-go/models/activity_total.go @@ -24,13 +24,13 @@ type ActivityTotal struct { Distance float32 `json:"distance,omitempty"` // The total elapsed time of the considered activities. - ElapsedTime int64 `json:"elapsed_time,omitempty"` + ElapsedTime float32 `json:"elapsed_time,omitempty"` // The total elevation gain of the considered activities. ElevationGain float32 `json:"elevation_gain,omitempty"` // The total moving time of the considered activities. - MovingTime int64 `json:"moving_time,omitempty"` + MovingTime float32 `json:"moving_time,omitempty"` } // Validate validates this activity total