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

filemanager: API should allow singular and list-based queries for the same key #707

Open
mmalenic opened this issue Nov 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working filemanager an issue relating to the filemanager

Comments

@mmalenic
Copy link
Member

The filemanager API can use [] to query for parameters that should be combined with an "or" condition. Query parameters without [] get combined into "and" conditions.

The following should be possible:

curl -H "Authorization: Bearer $TOKEN" https://file.dev.umccr.org/api/v1/s3?key=*.fastq.gz&key[]=*123*&key[]=*456*

Which could combine into a statement that looks like:

select *
from s3_object
where key like '%.fastq.gz' and (key like '%123%' or key like '%456%')

Currently this is not possible and results in a deserialization error:

"Failed to deserialize query string. Error: Multiple values for one key: \"key\""

Note, that I think the order of the query parameters shouldn't matter, so if they are out of order, keys with [] would be grouped anyway. Fixing this still won't enable complex logic that involves nesting conditions.

@mmalenic mmalenic self-assigned this Nov 19, 2024
@mmalenic mmalenic changed the title fix: filemanager api should allow singular and list-based queries for the same key bug: filemanager api should allow singular and list-based queries for the same key Nov 19, 2024
@mmalenic mmalenic changed the title bug: filemanager api should allow singular and list-based queries for the same key filemanager: API should allow singular and list-based queries for the same key Nov 19, 2024
@mmalenic mmalenic added filemanager an issue relating to the filemanager bug Something isn't working labels Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working filemanager an issue relating to the filemanager
Projects
None yet
Development

No branches or pull requests

1 participant