appwrite / sdk-for-android

[READ-ONLY] Official Appwrite Android SDK 💚 🤖
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
98 stars 21 forks source link

toString() on a Map.Entry in Kotlin returns the value around [ ] #8

Closed JohannHilbold closed 2 years ago

JohannHilbold commented 3 years ago

https://github.com/appwrite/sdk-for-android/blob/609275595d65c750a7a0970312b21766ed526a6d/library/src/main/java/io/appwrite/Client.kt#L175

it.value.toString() The toString function of a Map.Entry will add brackets around the string, which are then URL encoded to %5B and %5D which breaks the filter on the server side and returns nothing.

For example, if you call Database(Client.client).listDocuments("123456", filters = listOf("author=me@example.com"))

The URL generated will be http://192.168.0.1/v1/database/collections/123456/documents?filters%5B%5D=%5Bauthor%3Dme%40example.com%5D

The expected URL looks like this http://192.168.0.1/v1/database/collections/123456/documents?filters%5B%5D=author%3Dme%40example.com

see https://pl.kotl.in/leQ4MEljA

christyjacob4 commented 3 years ago

Thank you for raising this :+1: We'll fix this ASAP!

christyjacob4 commented 3 years ago

@JohannHilbold This has been fixed in #10 :smile:

lohanidamodar commented 2 years ago

Closing this as it was fixed, if the issue still exist feel free to reopen.