habitipy icon indicating copy to clipboard operation
habitipy copied to clipboard

Optional parameter not optional in habitipy

Open tr4nt0r opened this issue 10 months ago • 2 comments

When working on the Home Assistant Habitica integration i noticed the method for fetching the users tasks api.tasks.user.get(type=task_type) takes the parameter type as mandatory though for the habitica api it is optional. HA uses habitipy v. 0.2.0 but I updated to 0.3.0 and this was still an issue. Could you maybe take a look into this?

tr4nt0r avatar Apr 27 '24 16:04 tr4nt0r

This library parses apidoc from Habitica (see cached apidoc.txt). The param you mentioned is not "optional" in apidoc in Habitica. It is stated in description, but not marked in apidoc itself. I'll try and fix it in Habitica itself and create a hotfix here. But after that I'd need to rework the apidoc parser here, as it will no longer work with newer versions of Habitica.

asmfreak avatar Apr 28 '24 07:04 asmfreak

Thanks for the quick fix, already tested it and works like a charm. Now i can reduce the number of api call for tasks to 1 instead of 4 :)

tr4nt0r avatar Apr 28 '24 15:04 tr4nt0r