Skip to content

routine list: cannot unmarshal number into Routine.folder_id of type string #7

Description

@ntonthat-easygo

Summary

hevycli routine list fails entirely for accounts that organise routines into folders:

Error: failed to fetch routines: NETWORK_ERROR: failed to fetch routines: json: cannot unmarshal number into Go struct field Routine.routines.folder_id of type string

Cause

The Hevy API returns folder_id as a number for routines inside a folder (and null otherwise), while the Routine struct types it as string. Accounts with no folders are unaffected, which likely hid this in testing.

Repro

  1. In the Hevy app, put any routine inside a routine folder.
  2. hevycli routine list → unmarshal error, no output.

Verified on v0.3.0 (Homebrew cask, macOS arm64). Possibly related to #6 (response-shape mismatches) — a json.Number/custom unmarshaller or *int64 field would fix it.

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions