-
Notifications
You must be signed in to change notification settings - Fork 548
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
Unify request/response handling #808
Conversation
Thanks for putting this together Alex! So at first glance I have to say that this seemed a tad janky to me — something about switching this relatively important behavior off of Overall, my preference would be to leave things as they are because it's the most explicit/transparent, but I guess this would be okay if it's critical to client gen success. Another note: we've discussed quite a few times in the past about how we'd eventually like to a "service" closer to what's seen in .NET or Go so that all your API calls would be on separate objects like Also curious to hear @ob-stripe's thoughts as well! |
I think the one case this is missing is on static methods, which should not call Another thing I considered was checking for
It's definitely not critical to client gen success – it's more of a personal preference in finding the existing way things are written a bit confusing / hard to follow – why are these things spelled out the exact same way every time? What's really going on? Why is it sometimes tl;dr, as a reader to the library, I think I'd much prefer the same method in every place, with nice kwargs spelling out what the differences in behavior are. |
Yeah, fair enough. If we can get the same rule distributed everywhere, then I'm all for that. What I was getting at is that moving the logic up a method likely means that you just have to go up one layer of abstraction to understand what's going to happen, but it's probably not that big of a deal. |
Sorry for the super late reply! Generally agree with Brandur, this feels a bit janky to me but I won't block on it if it makes codegen easier. Nit: all requests return Stripe objects, so I would just name the method |
This reverts commit ea736eb.
101cd46
to
17d689a
Compare
r? @ob-stripe
cc @brandur-stripe
cc @stripe/api-libraries
Goal is to solve problems like #806 but also move ~everything to make requests the same way, with a single function call (except truly exceptional cases, where we need logic in handlers for backcompat etc).
Have updated this somewhat per feedback below.