Event data query API: Limit maximum allowed rows in query to 1000
Background
While looking for 500 errors returned by the API we noticed that many were related to the size of the returned dataset.
Currently there is no limit to the number of rows one can ask for.
Observed behavior
We've noticed some pretty large requests (10000 rows if not more in some cases) resulting in responses of ~170MB or more.
The API returns 1000 rows if the number of rows is not defined but will attempt to return as many rows as asked for.
A row value of -1 returns 10 results https://api.eventdata.crossref.org/v1/events?mailto=ppandis@crossref.org&rows=-1 but a row value < -1 fails with a 500
Expected behaviour
The API should return:
- 0 - 1000 rows if the parameter is defined and 0 <= rows <= 1000
- 1000 rows if rows is undefined
- status 400 + error details if rows > 1000 || rows < 0
Definition of ready
-
Product owner: @mrittman -
Tech lead: @ppandis -
Service:: label applied -
Definition of done updated -
Acceptance testing plan: outputs from queries for each case -
Weight applied
Definition of done
-
Unit tests identified, implemented, and passing -
Code reviewed -
Available for acceptance testing via a staging URL, or otherwise -
Knowledge base reviewed and updated -
Public documentation reviewed and updated -
Consider any impacts to current or future architecture/infrastructure, and update specifications and documentation as needed -
Acceptance criteria met -
All cases described in expected behaviour are returning the expected results
-
Notes
Edited by Martyn Rittman