Skip to content

Conversation

@RuthTurk
Copy link
Member

🗒️ Checklist

  1. run linter locally
  2. update developer docs (API, README, inline, etc.), if any
  3. for user-facing doc changes create a Zulip thread at #Support Docs Updates, if any
  4. draft PR with a title <type>(<scope>)<!>: <title> DEV-1234
  5. assign yourself, tag PR: at least Front end and/or Back end or workflow
  6. fill in the template below and delete template comments
  7. review thyself: read the diff and repro the preview as written
  8. open PR & confirm that CI passes & request reviewers, if needed
  9. delete this section before merging

📣 Summary

Change maximum number of results that /api/v2/data/ can return to 100 by default and 1000 maximum.

👀 Preview steps

  1. ℹ️ have an account and a project
  2. add over 100 submissions to the project
  3. Checkout the endpoint: /api/v2/assets/{uid_asset}/data/
  4. 🔴 [on main] the response body contains a results array with all the items
  5. 🟢 [on PR] the response body contains a results array with exactly 100 items
  6. Test that you can successfully request up to 1000 records, but no more
  7. Test that the offset parameter works correctly with the new limits

@RuthTurk RuthTurk self-assigned this Nov 14, 2025
@RuthTurk RuthTurk added API Changes related to API endpoints Back end labels Nov 14, 2025
@noliveleger noliveleger removed the request for review from jnm November 14, 2025 14:39
Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to change the behaviour in the data viewset.
If no limit is specified, it will always take the max limit while we want to return the default limit. The max limit should only cap a specified limit.

Moreover: Do not forgot to update the documentation. It still says 30000 ;-)

@RuthTurk RuthTurk removed the request for review from magicznyleszek November 20, 2025 22:26
@RuthTurk RuthTurk requested a review from noliveleger November 20, 2025 23:59
)
else:
# If no limit is specified, use the default limit (100)
filters['limit'] = 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use self.pagination_class.default_limit instead. To avoid redundancy.
We could even use self.pagination_class.max_limit instead of settings.SUBMISSION_LIST_LIMIT. What do you think?

@RuthTurk RuthTurk requested a review from noliveleger November 21, 2025 15:06
Copy link
Contributor

@noliveleger noliveleger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Labels

API Changes related to API endpoints Back end

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants