You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDK you're using (please complete the following information):
Version 4.27.0
Is your feature request related to a problem? Please describe.
A lot of the API methods have an insanely long list of parameters.
Here's one in my code: xero.projectApi.getTimeEntries(tenantId, projectId, userId, undefined, undefined, undefined, 1, 450, undefined, undefined, afterDate, beforeDate)
I don't think you can tell me this is ok :)
I feel wary upgrading to new versions as the order of these params may change, and depending on the types it may slip through without a compile error.
Describe the solution you'd like
It's a very large breaking change, though overloading may potentially be possible....
Just use an object. It's much more obvious what is happening, and additional parameters can be added easily without errors.
tenantId could be separate from the object.
Additionally, you could split the options into two parts, url parameters (in this case, projectId) and the POST body.
Describe alternatives you've considered
Some IDEs such as VS Code have a feature called "inlay hints" that write the parameter name directly inline in the call.
This would solve the readability problem, but updates still would be error prone...
The text was updated successfully, but these errors were encountered:
I like this idea but as you point out it's a large breaking change. We'll place this on hold with plans to explore implementing with the next breaking change
SDK you're using (please complete the following information):
Is your feature request related to a problem? Please describe.
A lot of the API methods have an insanely long list of parameters.
Here's one in my code:
xero.projectApi.getTimeEntries(tenantId, projectId, userId, undefined, undefined, undefined, 1, 450, undefined, undefined, afterDate, beforeDate)
I don't think you can tell me this is ok :)
I feel wary upgrading to new versions as the order of these params may change, and depending on the types it may slip through without a compile error.
Describe the solution you'd like
It's a very large breaking change, though overloading may potentially be possible....
Just use an object. It's much more obvious what is happening, and additional parameters can be added easily without errors.
tenantId could be separate from the object.
Additionally, you could split the options into two parts, url parameters (in this case, projectId) and the POST body.
Describe alternatives you've considered
Some IDEs such as VS Code have a feature called "inlay hints" that write the parameter name directly inline in the call.
This would solve the readability problem, but updates still would be error prone...
The text was updated successfully, but these errors were encountered: