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

CustomFieldsBase#findByWorkspace(String) has an incorrect return type. #60

Open
csnemeti opened this issue Oct 2, 2017 · 1 comment
Assignees

Comments

@csnemeti
Copy link

csnemeti commented Oct 2, 2017

The code for the method is like this:

public ItemRequest<CustomField> findByWorkspace(String workspace) {
   String path = String.format("/workspaces/%s/custom_fields", new Object[]{workspace});
   String path = String.format("/workspaces/%s/custom_fields", new Object[]{workspace});
   return new ItemRequest(this, CustomField.class, path, "GET");

}

Since you return ALL CustomField objects from a workspace the method should return CollectionRequest<CustomField> not a single item.
Calling the method generates Exception...

┆Issue is synchronized with this Asana task

@praecipula
Copy link
Contributor

Right you are, this does seem like a bug.

Since this is generated by our documentation and client library tool, I think the correct fix is to set collection: true in https://github.com/Asana/asana-api-meta/blob/master/src/resources/custom_fields.yaml on this endpoint. We'll get a fix in on our next round of client library / documentation updates. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants