Skip to content

[$75] "GET /taas-teams" must support perPage, page, sortBy, sortOrder, and name params #27

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

Closed
SathyaJayabal opened this issue Dec 2, 2020 · 13 comments

Comments

@SathyaJayabal
Copy link
Collaborator

GET taas-teams must support perPage and page params.

@nkumar-topcoder
Copy link
Contributor

@maxceem can you pls take a look this.

@maxceem
Copy link
Contributor

maxceem commented Dec 3, 2020

I had a look, understood the issue, and would update with details tomorrow.

@maxceem maxceem changed the title GET taas-teams must support perPage and page params GET taas-teams must support perPage and page params and sorting Dec 4, 2020
@maxceem maxceem changed the title GET taas-teams must support perPage and page params and sorting "GET /taas-teams" must support perPage, page, sortBy, sortOrder, and name params Dec 4, 2020
@maxceem
Copy link
Contributor

maxceem commented Dec 4, 2020

Internally GET /taas-teams endpoint calls Projects API GET /projects.
Projects API support sorting, pagination, and filtering by name: https://api.topcoder-dev.com/v5/projects/?sort=lastActivityAt+desc&perPage=20&page=1&name=*test*.

  1. GET /taas-teams should support pagination params page and perPage (pass to Projects API).

  2. GET /taas-teams should support sorting params sortBy and sortOrder and pass them to Projects API in one param sort as sort=<sortBy>+<sortOrder>

  3. GET /taas-teams should support filtering param name and pass it to Projects API

  4. Make sure that all these params work as per the description above and I didn't miss anything.

  5. Update API documentation: Swagger, Potman.

FYI @nkumar-topcoder

@maxceem maxceem added the enhancement New feature or request label Dec 4, 2020
@maxceem maxceem changed the title "GET /taas-teams" must support perPage, page, sortBy, sortOrder, and name params [$75] "GET /taas-teams" must support perPage, page, sortBy, sortOrder, and name params Dec 4, 2020
@maxceem
Copy link
Contributor

maxceem commented Dec 4, 2020

@imcaizheng you may pick it up if it looks good for you.

@imcaizheng imcaizheng self-assigned this Dec 4, 2020
@imcaizheng
Copy link
Contributor

PR created #44

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

Contest https://www.topcoder.com/challenges/30156198 has been created for this ticket.

This is an automated message for maxceem via Topcoder X

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

Contest https://www.topcoder.com/challenges/30156198 has been updated - it has been assigned to aaron2017.

This is an automated message for maxceem via Topcoder X

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

Works good.

The only thing, I guess we shouldn't add result when we return arrays in the response because as per swagger we have to return arrays of records directly, like:

[
  {},
   ...
  {}
]

instead of

{ 
   result: [
     {},
      ...
     {}
   ]
}

So I removed result for all the "list" endpoints f3328f7

@imcaizheng please, let me know if I missed something, and we should handle it another way, rather than removing result.

@imcaizheng
Copy link
Contributor

@maxceem other operations such as GET /jobs, GET /jobCandidates and GET /resourceBookings return data with the result field, I think it may make API clients a little happy by letting GET /taas-teams to return data the same way, also considering the taas-teams endpoints were developed after the jobs, jobCandidates and resourceBookings endpionts. I would prefer to change the swagger spec instead if it is not too late to do that.

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

Thanks, @imcaizheng.

@nkumar-topcoder as per swagger and implementation all list endpoints return data in result field:

image

While endpoints which return single records, return data directly without result field:

image

Also, other Topcoder V5 API return all the data without result field in the response. For example Challenges API:

image

Do you know if there was some intention behind adding result for the "list" endpoints or this happened unintentionally?
Also, I think Topcoder API V5 guidelines require to return data directly.

@nkumar-topcoder
Copy link
Contributor

@maxceem
not sure , @veshu can help us here. pls reach out to him (offline on slack).
feel free to implement as deemed fit. thanks

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

Ok, I believe there should not be result in responses, so I've removed it in endpoints and in Swagger.

@maxceem
Copy link
Contributor

maxceem commented Dec 7, 2020

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30156198

This is an automated message for maxceem via Topcoder X

@maxceem maxceem added this to the v1.0 - Initial Launch milestone Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants