irma-frontend icon indicating copy to clipboard operation
irma-frontend copied to clipboard

Incomplete API /results

Open commial opened this issue 10 years ago • 0 comments

Looking for the API /scans/<scanid>/results, the description says you'll get a results property containing the total count of scan results items. Accordingly, in the Model description:

{
  "total": 0,
  "offset": 0,
  "limit": 0,
  "data": [ { ... } ]
}

Actually, only data is returned (without naming it). In addition, the parameters limit and offset are completely ignored (unlike frontend/api/controllers/scans.py: list()). So, on a big scan, there is now way to get back just the number of result, and then iterate over it through a window [offset, offset + limit] (/scans/{scanId} and /scans/<scanid>/results return the full list of results).

Cosmetic one: the docstring of frontend/api/controllers/scans.py: get_results says The request should be performed using a POST request method, where it is actually a GET.

commial avatar Aug 06 '15 13:08 commial