-
Notifications
You must be signed in to change notification settings - Fork 1
Add pagination support to /submitters endpoint #25
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
…ation Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
|
@copilot Change the return type by wrapping the submitters list into an object that contains the total count. It should be analogous to programs and sequences. |
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
Done in commit 54c5d4f. The endpoint now returns |
|
@copilot Move the /stats/submitters endpoint to /submitters. Add a "Submissions" tag to the spec and use it for this endpoint instead of Stats. |
Co-authored-by: ckrause <840744+ckrause@users.noreply.github.com>
The submitters endpoint lacked pagination, making it inefficient for clients to retrieve large datasets. This adds
limitandskipquery parameters and wraps the response in an object with total count.Changes
Handler (
cmd/stats/main.go)limitandskipusing existingutil.ParseLimitSkipShuffle(default: 10, max: 100)totalcount andresultsarraylimit=0returns all results/v2/submitters(organized with submission-related endpoints)SubmittersResult Structure (
shared/people.go)SubmittersResultwithTotal(int) andResults([]Submitter)SearchResultused by programs and sequences endpointsTests (
cmd/stats/submitters_test.go)totalandresultsAPI Spec (
openapi.v2.yaml)SubmittersResultschema definition/submittersuses Submissions tagLimitcomponent:minimum: 0to allow unlimited resultsTest Script (
test.sh)Response Format
{ "total": 100, "results": [ { "name": "submitter1", "numPrograms": 50 }, { "name": "submitter2", "numPrograms": 30 } ] }Usage
Follows the same response pattern as
/sequences/searchand/programs/searchfor consistency.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.