Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tasks_base.rb#get_tasks() pagination broken #110

Open
apiology opened this issue Jul 28, 2021 · 1 comment · May be fixed by #112
Open

tasks_base.rb#get_tasks() pagination broken #110

apiology opened this issue Jul 28, 2021 · 1 comment · May be fixed by #112

Comments

@apiology
Copy link

/tasks appears to be a legacy endpoint which requires limit be specified if the number of tasks returned would require pagination:

Unfortunately, 'limit' is not sent in automatically in the Ruby client library, nor is it allowed to be sent in by the client library user. Arguably it should be a keyword argument that defaults to 20 and can be overridden.

As a result, in Ruby, client.tasks.get_tasks() cannot be used when it would return a great number of items.

In addition, the documentation is wrong, as it suggests you can pass in 'limit' as part of the options - this has no effect, as it gets translated to 'opt_limit', which is not recognized by the API.

apiology added a commit to apiology/ruby-asana that referenced this issue Jul 29, 2021
Also allow user config of page size.

Fixes Asana#110
@apiology
Copy link
Author

I've tweaked the generated code here: https://github.com/Asana/ruby-asana/compare/master...apiology:per_page_for_get_tasks?expand=1

I've tested with my use case and it works great. Happy to offer that as a PR.

I tried to regenerate the code from the OpenAPI spec in the hopes I could fix this in the templating process somewhere. Unfortunately, the referenced https://github.com/rossgrambo/swagger-codegen from @rossgrambo is not a valid public repo (see https://github.com/Asana/developer-docs/blob/master/Makefile#L60). The unforked version gives me an error: Exception in thread "main" java.lang.RuntimeException: Can't load config class with name asana-ruby.

apiology added a commit to apiology/checkoff that referenced this issue Jul 30, 2021
Adds a CLI 'mv' subcommand, which supports adding projects to tasks within the same workspace and changing their sections for now.

Move over to get_tasks() in ruby-asana, as get_tasks_for_section() lacks completed_since support.

Use forked version of ruby-asana gem for development use, as ruby-asana is pending key bugfixes for checkoff:

See

* Asana/ruby-asana#109
* Asana/ruby-asana#110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant