-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[ruby] Introduce ApiModelBase to reduce code duplication #22052
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
Conversation
6304e3b to
50be973
Compare
|
Some notable files to see the general diff pattern
|
|
I did want to point out I deleted those inline_object files in the ruby petstore sample because they aren't generated and look like something old and unused. If they aren't, let me know and I will restore them with manual changes matching the new pattern. |
|
Is this PR ready for review? |
The Ruby code that is generated copies numerous methods into every model. This creates bloat both in file size and run-time memory usage. This commit introduces a base class for all models to store common methods. This commit's focus is only on static methods that do not change between models.
50be973 to
f55ba7c
Compare
|
Thanks for the poke @wing328 - I've un-drafted this PR. |
|
thanks for the PR let's give it a try |
|
@wing328 - This looks like it landed in 7.17.0, but didn't have the milestone. Considering it's a bigger change that users might see, we might want to add it to the milestone and the release. |
|
done. updated the release note too. |
The Ruby code that is generated copies numerous methods into every model. This creates bloat both in file size and run-time memory usage. This commit introduces a base class for all models to store common methods. This commit's focus is only on static methods that do not change between models.
The Ruby code that is generated copies numerous methods into every model. This creates bloat both in file size and run-time memory usage. This commit introduces a base class for all models to store common methods. This commit's focus is only on static methods that do not change between models.
Part of #22051
@cliffano @zlx @autopp
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)