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

🐛 Bug Report: Using falsy values for optional parameters #5416

Closed
2 tasks done
Suven-p opened this issue Apr 21, 2023 · 2 comments
Closed
2 tasks done

🐛 Bug Report: Using falsy values for optional parameters #5416

Suven-p opened this issue Apr 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.

Comments

@Suven-p
Copy link
Contributor

Suven-p commented Apr 21, 2023

👟 Reproduction steps

When I make a request to
path := r.Replace("/databases/{databaseId}/collections/{collectionId}/attributes/string")
with parameters

params := map[string]interface{}{
        "key": Key,
        "size": Size,
        "required": Required,
        "default": Default,
        "array": Array,
}

and value of default is an empty string.

👍 Expected behavior

Handle empty strings as parameter not being sent.
https://discord.com/channels/564160730845151244/1099033836731519006

👎 Actual Behavior

It throws an error in appwrite 1.3.1 but not in older versions of appwrite.

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@Suven-p Suven-p added the bug Something isn't working label Apr 21, 2023
@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Apr 21, 2023
@stnguyen90 stnguyen90 self-assigned this Apr 21, 2023
@stnguyen90
Copy link
Contributor

@Suven-p, thanks for creating this issue! 🙏🏼 It makes perfect sense to allow an empty string as the default. I'll bring this up to the team to see how we can proceed.

@joeyouss
Copy link

This has been fixed here: #5602

Thank you again for bringing this up @Suven-p , we have implemented it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

3 participants