Void argument routes should not require `null`
See original GitHub issueWhen calling an endpoint that does not accept any parameters (e.g. usersGetCurrentAccount()
), null
must be passed as an argument. This is somewhat confusing and the error message returned when you forget to pass null
doesn’t help either:
> dbx.usersGetCurrentAccount()
POST https://api.dropboxapi.com/2/users/get_current_account 400 (Bad Request)
Error in call to API function "users/get_current_account": request body: could not decode input as JSON
> dbx.usersGetCurrentAccount(null)
lib$es6$promise$promise$$Promise {xot8798dunmi: 2, _state: undefined, _result: undefined, _subscribers: Array[0]}
We should default to sending null
when no argument is supplied.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Is it better to use C void arguments "void foo(void)" or not "void ...
In C it means "could take any number of parameters of unknown types", and in C++ it means the same as foo(void) ....
Read more >"void *" should not be used in typedefs, member variables ...
Parameters in an overriding virtual function shall either use the same default arguments as the function ... "nonnull" pointers should not be set...
Read more >Why do I get an error "value cannot be null (Parameter 'type ...
Reload() is called in the WritableOptions class, I get an multiple errors: (Value cannot be null (Parameter 'type')). I do not have the...
Read more >no-invalid-void-type - TypeScript ESLint
This pattern can be useful to explicitly label function types that do not use a this argument. See the TypeScript docs for more...
Read more >Understanding null safety - Dart programming language
Optional parameters must have a default value. If you don't pass an argument for an optional positional or named parameter, then the language...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue still remains, in the typescript definitions.
This should be fixed for TypeScript as of the latest version, v7.0.0.