Strava powerstream first value

19 views
Skip to first unread message

lucas

unread,
Jan 19, 2023, 3:53:38 PM1/19/23
to Strava API

Hi everyone,

When trying to use the Strava API with wattages per second I keep running into the problem of the first value always being null instead of a number.

struct streamsElement: Decodable { struct Stream: Decodable { let data: [Double]? let series_type: String let original_size: Int let resolution: String }

This works fine for all the other streams.

How can i turn this Null value into a zero so I don't get a JSON decoding error?

I tried to skip the first value in the decoding but this did not work.

Best regards Lucas

Reply all
Reply to author
Forward
0 new messages