sachaos / todoist

Todoist CLI Client. I ❤️ Todoist and CLI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

request for completed items returns Error: json: cannot unmarshal number into Go struct field CompletedItem.items.user_id of type string

dasice opened this issue · comments

commented

I'm assuming this is a deprecated API? Is there some way I can dump the contents of the JSON to help debug?

Confirmed that this is a bug, running latest master.

This looks to be a bug in the response coming from the Todoist API.

The "user_id" field is returning as an integer instead of a string as in their API documentation. https://developer.todoist.com/sync/v9/#get-all-completed-items

I think for now the best course of action is to wait a few days for Todoist to resolve it on their end. I've opened a support ticket with Todoist to report this bug.

BTW you can pass a --debug flag to todoist but unfortunately it does not log the response body so it doesn't help with troubleshooting an error in the JSON.

commented

yeah it would be nice for the debug to dump the json in the case that there's an error, but it's not a big deal

Got a response from todoist support. They said they are going to look into this and determine if the API change was intentional or not.

@dasice I created #233 to add logging for the API response.

@dasice todoist support says this is now resolved, it was a bug in their API that caused this.

UPDATE: We found the bug and made the correction now. The documentation was correct and so you should now be getting strings (and not integers) going forward.

commented

Thank you, I can confirm that it works for me now, I really appreciate your upstream representation.