Skip to content
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

Hand orderByFields, limit and offset to SILO #290

Closed
fengelniederhammer opened this issue Jul 10, 2023 · 3 comments · Fixed by #300 or #778
Closed

Hand orderByFields, limit and offset to SILO #290

fengelniederhammer opened this issue Jul 10, 2023 · 3 comments · Fixed by #300 or #778
Assignees
Labels
LAPIS Tasks/PR related to LAPIS

Comments

@fengelniederhammer
Copy link
Contributor

fengelniederhammer commented Jul 10, 2023

SILO allows the fields orderByFields, limit and offset on every action. Accept them as additional query parameters (GET requests) or in the response body (POST requests) and pass them on.

@fengelniederhammer fengelniederhammer added the LAPIS Tasks/PR related to LAPIS label Jul 10, 2023
@chaoran-chen
Copy link
Member

chaoran-chen commented Jul 10, 2023

It would actually be great if you can support ascending/descending as well but I'm not sure what a good and easy format would be.

Would ...?orderBy=country(asc),date(desc) be a good syntax (where the order is optional)? ( and ) do not need special encoding, so it is possible to type such an URL easily by hand.

Happy to hear other suggestions!

@fengelniederhammer
Copy link
Contributor Author

At least in POST requests we could accept both (similar to SILO)

{ "orderBy": ["country", "date"] }

and

{ "orderBy": [
   { "field": "country", "type": "descending" },
   { "field": "date", "type": "ascending" }
]}

We could also decide to only allow the second version, since we expect POST requests to be mostly generated programmatically, so we don't need a short version.

Do we need to support this in GET requests? I don't have any better idea and I suspect that no one might ever use that.

@chaoran-chen
Copy link
Member

Good point, only supporting that in POST requests would be enough probably! Let's do that for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LAPIS Tasks/PR related to LAPIS
Projects
None yet
2 participants