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

Bad Request: while fetching all the files within a bucket #2

Closed
rudrankriyam opened this issue Sep 11, 2021 · 5 comments
Closed

Bad Request: while fetching all the files within a bucket #2

rudrankriyam opened this issue Sep 11, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@rudrankriyam
Copy link
Contributor

rudrankriyam commented Sep 11, 2021

Bug report

Describe the bug

Bad request error while fetching all the files within a bucket.

To Reproduce

After fetching the buckets successfully, the list method returns a bad request.

let client = SupabaseClient(supabaseUrl: "{ base url }", supabaseKey: "{ key }")

client.storage.listBuckets { result in
    switch result {
        case .success(let buckets):
            guard let bucket = buckets.first else { return }
            let file = client.storage.from(id: bucket.id)
            
            file.list { fileResult in
                switch fileResult {
                    case .success(let objects):
                        print(objects)
                    case .failure(let error):
                        print(error)
                }
            }
        case .failure(let error):
            print(error)
    }
}

Expected behaviour

After forking the package and printing the data, I found that the body is missing the prefix parameter -

body should have required property 'prefix'

Adding the prefix parameter worked, and it returned the files. However, there's no mention of the prefix in the JS docs.

@rudrankriyam rudrankriyam added the bug Something isn't working label Sep 11, 2021
@CodeJonesW
Copy link

I am having a similar issue when using from.remove()
message: "body should have required property 'prefixes'", status: 400

How did you add this property using the client methods?

CodeJonesW referenced this issue in sharkstewardsdeveloper/shark-reporting Sep 17, 2021
@rudrankriyam
Copy link
Contributor Author

I forked the repo, added the package to my project and made the change manually. I couldn’t think of any alternate solutions

@CodeJonesW
Copy link

Thanks

@rudrankriyam
Copy link
Contributor Author

rudrankriyam commented Sep 17, 2021

Their C# and python clients do use prefixes in the body, so it looks like the documentation is outdated.

You can fork and make the necessary changes. I'll send a PR for this

@rudrankriyam
Copy link
Contributor Author

Solved by #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants