-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(filemanager): accept multiple keys in API #596
Conversation
curl -H "Authorization: Bearer $TOKEN" "https://file.dev.umccr.org/api/v1/s3?bucket[]=bucket1&bucket[]=bucket2" | jq | ||
``` | ||
|
||
Note that the extra `[]` is required in the query parameters to specify multiple keys with the same name. Multiple keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason behind it where it needs to have the []
for a multiple key? Will this be mutually exclusive with the params that does not have the []
? Say ...s3?bucket=bucket1&bucket[]=bucket2
is not possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required in the library that parses the query string: https://github.com/samscott89/serde_qs. I think the choice by the author has to do with matching the style of ruby on rails.
Yes, this is mutually exclusive, you can't combine keys with []
and without it.
For example, this works:
/api/v1/s3?key=...
/api/v1/s3?key[]=...
/api/v1/s3?key[]=...&key[]=...
But this results in an error:
/api/v1/s3?key=...&key[]=...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the quick feature request update.
Closes #595
Changes
or
statement in the SQL query.[]
syntax to specify a list. E.g./api/v1/s3?key[]=key1&key[]=key2
.or
condition.