-
Notifications
You must be signed in to change notification settings - Fork 354
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
Void argument routes should not require null
#41
Comments
Legit catch. |
thanks for catching this @krieb |
The issue still remains, in the typescript definitions. |
@bobmoff Apologies for the delay, and thanks for the note. We'll look into it. |
@jvilk a seemingly simple fix here is to remove the |
@pran1990 Yes, that is correct. Note that that file is auto-generated from the stone specification, which specifies that that route takes an argument of type 'void'. You should change the TypeScript stone generator to special-case the output of routes that take a void argument. Here's an (untested) change to the generator that should work (forgive any syntax errors / things that aren't best practice; I don't often write Python code): arg_data_type = fmt_type(route.arg_data_type)
if route.arg_data_type == "void":
self.emit('public %s(): Promise<%s>;' %
(function_name, fmt_type(route.result_data_type)))
else:
self.emit('public %s(arg: %s): Promise<%s>;' %
(function_name, arg_data_type, fmt_type(route.result_data_type))) Hope that helps! |
It's already fixed issue, and that's should be closed |
Apologies, the original issue was resolved, but we had this still open for the same issue in TypeScript. |
Newest version should fix the issue. |
- Fix for ([JS #41](dropbox/dropbox-sdk-js#41)) - Update route to not have `arg` when there is no parameter - Update comments to also not contain `arg` when no parameter - Update tests for both clients
* Update JS and TS routes to remove null parameters - Fix for ([JS #41](dropbox/dropbox-sdk-js#41)) - Update route to not have `arg` when there is no parameter - Update comments to also not contain `arg` when no parameter - Update tests for both clients
This should be fixed for TypeScript as of the latest version, v7.0.0. |
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 passnull
doesn't help either:We should default to sending
null
when no argument is supplied.The text was updated successfully, but these errors were encountered: