-
Notifications
You must be signed in to change notification settings - Fork 547
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
Custom method signature requirements #855
Comments
Hi @joeltaylor, thanks for the feedback. I think there are two kinds of API operations that need to be distinguished:
The latter need a resource ID, the former don't. So the signatures need to be different:
Unfortunately, for historical reasons the signature of I could be wrong but I think We should probably fix |
Thanks for the rundown @ob-stripe! I think that all makes sense given the two kinds of API operations. What do you think about an improved error message for when an api key is detected within the params portion of the signature? This was the error message I found confusing:
I may be an outlier with my use case, but would be happy to take a stab at a PR or close the issue if it's superfluous. |
Right, we can definitely improve the error message. I'll be happy to review a PR if you want to take a stab at it! |
Summary
I've noticed that there are some unexpected differences between CRUDL and the custom method signatures.
For example, I commonly perform operations with the following signature:
Which usually leads me to try something like:
Because what it really wants is:
After a bit of thrashing, I usually remember the signature difference, but it strikes me as odd that
params
is in the signature of the signature for some methods that don't accept them (e.g. canceling a PaymentIntent doesn't accept any).Thoughts/ideas
.retrieve
method signature may be deprecated so I'm not sure if the signature I've been using is on the chopping block.I'm happy to help out and open a PR!
The text was updated successfully, but these errors were encountered: