Back

Databases.update#Attribute general_argument_invalid, Param "default" is not optional

  • 0
  • Self Hosted
jaboyc
10 Oct, 2023, 00:50

Hello. I am creating a Dart script to automatically update my collection attributes. When I call Databases.updateStringAttribute(... xdefault: null), I get an error AppwriteException: general_argument_invalid, Param "default" is not optional. (400) This applies to all attribute types, not just strings.

I am using dart_appwrite 10.0.0 in my dart code and I am using a self-hosted Appwrite with version 1.4.4

What can I do to debug this? I don't see anyone else experiencing this issue so I'm not sure if I'm just missing something. Any help is appreciated. Thanks!

TL;DR
I am getting an error when trying to update collection attributes in a Dart script using the `Databases.updateStringAttribute(... xdefault: null)` method. The error message says "Param 'default' is not optional." This issue applies to all attribute types, not just strings. I am using dart_appwrite 10.0.0 and self-hosted Appwrite 1.4.4. I have tried to modify the code to fix the issue, but it seems like a hacky solution. I am looking for help to debug this problem. Solution: The user suggests modifying the code by removing the line `params.remove
jaboyc
10 Oct, 2023, 13:39

I've found that modifying https://github.com/appwrite/sdk-for-dart/blob/master/lib/src/client_mixin.dart#L15 to params.removeWhere((key, value) => value == null && key != 'default'); fixes that for me, but that seems like a hacky solution.

Drake
11 Oct, 2023, 02:05

would you please create an issue in our appwrite repo for this?

jaboyc
11 Oct, 2023, 12:31

I've created https://github.com/appwrite/sdk-for-dart/issues/47. Also created https://github.com/appwrite/sdk-for-dart/issues/48 as another issue I've dealt with as I'm creating this Dart script to update my collection attributes.

jaboyc
11 Oct, 2023, 12:33

Also heads up, the code of conduct link found in the issue template is broken: https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more