question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Void argument routes should not require `null`

See original GitHub issue

When 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bobmoffcommented, Feb 28, 2018

The issue still remains, in the typescript definitions.

0reactions
greg-dbcommented, Oct 7, 2020

This should be fixed for TypeScript as of the latest version, v7.0.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found