[ruby] Introduce ApiModelBase to reduce code duplication#22052
Merged
wing328 merged 1 commit intoOpenAPITools:masterfrom Oct 28, 2025
Merged
[ruby] Introduce ApiModelBase to reduce code duplication#22052wing328 merged 1 commit intoOpenAPITools:masterfrom
wing328 merged 1 commit intoOpenAPITools:masterfrom
Conversation
6304e3b to
50be973
Compare
Contributor
Author
|
Some notable files to see the general diff pattern
|
Contributor
Author
|
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. |
Member
|
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
Contributor
Author
|
Thanks for the poke @wing328 - I've un-drafted this PR. |
Member
|
thanks for the PR let's give it a try |
Contributor
Author
|
@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. |
Member
|
done. updated the release note too. |
This was referenced Nov 24, 2025
rajvesh
pushed a commit
to rajvesh/openapi-generator
that referenced
this pull request
Dec 25, 2025
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)