Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/generators/ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|gemLicense|gem license. | |unlicense|
|gemMetadata|gem metadata.| |{}|
|gemName|gem name (convention: underscore_case).| |openapi_client|
|gemRequiredRubyVersion|gem required Ruby version. | |>= 2.4|
|gemRequiredRubyVersion|gem required Ruby version. | |>= 2.7|
|gemSummary|gem summary. | |A ruby wrapper for the REST APIs|
|gemVersion|gem version.| |1.0.0|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
protected String specFolder = "spec";
protected String libFolder = "lib";
@Setter protected String gemLicense = "unlicense";
@Setter protected String gemRequiredRubyVersion = ">= 1.9";
@Setter protected String gemRequiredRubyVersion = ">= 2.7";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new >= 2.7 default contradicts the CliOption default for this same option, which still shows defaultValue(">= 2.4") on line 167. That CLI default is what users see in config-help and what is auto-generated into docs/generators/ruby.md (row: |gemRequiredRubyVersion|gem required Ruby version. | |>= 2.4|), so the documented default remains below the new minimum and users generating from that default (e.g. via a copied JSON config) still get gems requiring >= 2.4. Update the CliOption default to >= 2.7 and regenerate the ruby generator docs so the advertised default matches the new minimum.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java, line 72:

<comment>The new `>= 2.7` default contradicts the `CliOption` default for this same option, which still shows `defaultValue(">= 2.4")` on line 167. That CLI default is what users see in `config-help` and what is auto-generated into `docs/generators/ruby.md` (row: `|gemRequiredRubyVersion|gem required Ruby version. | |&gt;= 2.4|`), so the documented default remains below the new minimum and users generating from that default (e.g. via a copied JSON config) still get gems requiring `>= 2.4`. Update the `CliOption` default to `>= 2.7` and regenerate the ruby generator docs so the advertised default matches the new minimum.</comment>

<file context>
@@ -69,7 +69,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
     protected String libFolder = "lib";
     @Setter protected String gemLicense = "unlicense";
-    @Setter protected String gemRequiredRubyVersion = ">= 1.9";
+    @Setter protected String gemRequiredRubyVersion = ">= 2.7";
     @Setter protected String gemHomepage = "https://openapitools.org";
     @Setter protected String gemSummary = "A Ruby SDK for the REST API";
</file context>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This field default does not reach the generated gemspec, so changing it (and the old >= 1.9) has no effect on generated output. processOpts only calls setGemRequiredRubyVersion when the user supplies the property and never writes the field back into additionalProperties, and the field is read nowhere else (it only has a @Setter, no getter). The gemspec's actual minimum comes from gemspec.mustache line 21, whose own fallback is already >= 2.7. Either propagate the field value into additionalProperties (so the class remains the single source of truth) or drop the now-duplicated default; otherwise the two defaults will drift again.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java, line 72:

<comment>This field default does not reach the generated gemspec, so changing it (and the old `>= 1.9`) has no effect on generated output. `processOpts` only calls `setGemRequiredRubyVersion` when the user supplies the property and never writes the field back into `additionalProperties`, and the field is read nowhere else (it only has a `@Setter`, no getter). The gemspec's actual minimum comes from `gemspec.mustache` line 21, whose own fallback is already `>= 2.7`. Either propagate the field value into `additionalProperties` (so the class remains the single source of truth) or drop the now-duplicated default; otherwise the two defaults will drift again.</comment>

<file context>
@@ -69,7 +69,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
     protected String libFolder = "lib";
     @Setter protected String gemLicense = "unlicense";
-    @Setter protected String gemRequiredRubyVersion = ">= 1.9";
+    @Setter protected String gemRequiredRubyVersion = ">= 2.7";
     @Setter protected String gemHomepage = "https://openapitools.org";
     @Setter protected String gemSummary = "A Ruby SDK for the REST API";
</file context>

@Setter protected String gemHomepage = "https://openapitools.org";
@Setter protected String gemSummary = "A Ruby SDK for the REST API";
@Setter protected String gemDescription = "This gem maps to a REST API";
Expand Down Expand Up @@ -164,7 +164,7 @@ public RubyClientCodegen() {
defaultValue("unlicense"));

cliOptions.add(new CliOption(GEM_REQUIRED_RUBY_VERSION, "gem required Ruby version. ").
defaultValue(">= 2.4"));
defaultValue(">= 2.7"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Raising the minimum Ruby version to 2.7 leaves the ruby-client RuboCop template stale: modules/openapi-generator/src/main/resources/ruby-client/rubocop.mustache still generates TargetRubyVersion: 2.4, and the regenerated samples confirm it (e.g. samples/client/petstore/ruby/.rubocop.yml still says TargetRubyVersion: 2.4). For consistency with the new required_ruby_version, bump the template to 2.7 and regenerate the samples.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java, line 167:

<comment>Raising the minimum Ruby version to 2.7 leaves the ruby-client RuboCop template stale: `modules/openapi-generator/src/main/resources/ruby-client/rubocop.mustache` still generates `TargetRubyVersion: 2.4`, and the regenerated samples confirm it (e.g. `samples/client/petstore/ruby/.rubocop.yml` still says `TargetRubyVersion: 2.4`). For consistency with the new `required_ruby_version`, bump the template to 2.7 and regenerate the samples.</comment>

<file context>
@@ -164,7 +164,7 @@ public RubyClientCodegen() {
 
         cliOptions.add(new CliOption(GEM_REQUIRED_RUBY_VERSION, "gem required Ruby version. ").
-                defaultValue(">= 2.4"));
+                defaultValue(">= 2.7"));
 
         cliOptions.add(new CliOption(GEM_HOMEPAGE, "gem homepage. ").
</file context>


cliOptions.add(new CliOption(GEM_HOMEPAGE, "gem homepage. ").
defaultValue("https://openapi-generator.tech"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/ruby-faraday/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/ruby-httpx/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/ruby-typhoeus/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-autoload/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-faraday/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby-httpx/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Expand Down
Loading