Reworked pagination #6
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "refs/pull/6/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
New pagination works on the side of the Elasticsearch. Still needs test-coverage and Swagger documentation coverage.
Made minor code clean-ups.
API URI versioning added.
Swagger documentation added.
Docker-compose problems fixed. Tests fixed.
Examples of API calls
Response structure
Structure of the API response is presented below. In general, API response for /papers/{uuid} endpoint is the single document and for /papers/search - is a page, which contains documents acquired through querying Elasticsearch (ontained in 'data' array property) and metadata, which provides additional information about current page (contained in 'meta' property).
Property 'data' holds an array of documents, returned from the Elasticsearch.
Property 'meta' holds an object of metadata for the page.
/papers/{uuid}
This example demonstrates the case of addressing the /papers/{uuid} endpoint.
Request
Response
As you can see - when /papers/{uuid} endpoint is accessed - the result is the single document (paper).
/papers/search?
List of query parameters:
query (Mandatory, string)
page (Optional, number)
limit (Optional, number)
order (Optional, string, "asc"/"desc")
Example, provided below demonstrates the case of addressing the /papers/search? endpoint.
Request
Response
Here - the 'data' property holds 3 elements (limit per page is specified in the appropriate query parameter). This limit is also present in 'meta' property, as 'pagesize'.