-
Notifications
You must be signed in to change notification settings - Fork 353
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
Fix for getting account by id #786
base: main
Are you sure you want to change the base?
Conversation
@maartenvanvliet Thanks for working on this! Maybe it's just me, but Is there a benefit to having an |
I agree that it's aesthetically less pleasing to have this one exception to how it's done the sdk and naming this function The I'm not particularly attached to any function name and think something can be said for all of them. If there's consensus on the issue I'll push the changes. |
Oh right, my mistake! I'm not a go expert by any means, but I suspect that Personally, I don't see anything wrong with |
I mentioned that the two operations are not uniquely named in the schema but have failed to highlight the underlying issue. Thing is we cannot support The simplest fix is to rename one of those functions to something else, that's why the overrides are there. The complicated fix is to have the generated code handle the different cases. This would imo hamper maintainability of the code for something that has 3 occurrences in the entire Stripe open api schema. In light of this discussion, I propose to go with |
It's been a couple days and I'm unable to come up with anything better. 🙂 I like |
@yordis I'll try to find some time to fix the conflicts and address the comments so this can be merged. |
Sorry to be late to the party! I am a bit confused. What is the difference between Purely looking based on the test, I am used to Elixir leveraging pattern matching to avoid function explosion, so having a function that accepts a string or an object and things like that is expected. |
The issue is that the automatically generated functions clash in a few cases because of arity and defaults. In this case you'll get |
CI failing, overall looking good 🚀 💜 |
This pull request has been automatically marked as "stale:discard". If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated!. |
Hey 👋 do you have any updates on this? |
@gmrcp please do 🙏🏻 |
CI failures are fixed, I also fixed an unrelated CI failure that was erroring with query params. |
Should this be a breaking change? 🤔 |
Hey everyone, @maartenvanvliet, is there any chance you can resolve the conflicts? |
@yordis anyway we can get this merged in? |
@cgarvis I have a #853 where we must manually add ALL mapping. I do not want to make assumptions anymore; everything is explicit until we fix the anti-pattern (we should flatten the codegen and use operation ID as identity). I would take any help with |
Hey 👋
I added a way to override the method_name for an operation. These are not unique per schema apparently.
Did some cursory exploration on how other stripe sdk's deal with this:
null
.I've gone with the go way of fixing this and added
retrieve_by_id
. Two other resources had the same issue but naming was more straightforward there.Also, the
method_on: "collection"
Stripe operations are now skipped. They were duplicates of the "service" operations and I think only used for code generation by Stripe itself.fixes #777