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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Samples Ruby Idiomatic
name: Samples ruby-nextgen

on:
push:
paths:
- 'samples/client/petstore/ruby-idiomatic/**'
- 'samples/client/others/ruby-idiomatic-qdrant/**'
- 'samples/client/petstore/ruby-nextgen/**'
- 'samples/client/others/ruby-nextgen-qdrant/**'
pull_request:
paths:
- 'samples/client/petstore/ruby-idiomatic/**'
- 'samples/client/others/ruby-idiomatic-qdrant/**'
- 'samples/client/petstore/ruby-nextgen/**'
- 'samples/client/others/ruby-nextgen-qdrant/**'

jobs:
build:
name: Build Ruby Idiomatic client
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/client/petstore/ruby-idiomatic
- samples/client/petstore/ruby-nextgen
ruby-version:
- '3.0'
- '3.3'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generatorName: ruby-idiomatic
outputDir: samples/client/others/ruby-idiomatic-qdrant
generatorName: ruby-nextgen
outputDir: samples/client/others/ruby-nextgen-qdrant
inputSpec: modules/openapi-generator/src/test/resources/3_0/crystal/qdrant.json
templateDir: modules/openapi-generator/src/main/resources/ruby-idiomatic
templateDir: modules/openapi-generator/src/main/resources/ruby-nextgen
globalProperties:
apiTests: "true"
modelTests: "true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generatorName: ruby-idiomatic
outputDir: samples/client/petstore/ruby-idiomatic
generatorName: ruby-nextgen
outputDir: samples/client/petstore/ruby-nextgen
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/ruby-idiomatic
templateDir: modules/openapi-generator/src/main/resources/ruby-nextgen
globalProperties:
apiTests: "true"
modelTests: "true"
Expand Down
2 changes: 1 addition & 1 deletion docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The following generators are available:
* [python-pydantic-v1](generators/python-pydantic-v1.md)
* [r](generators/r.md)
* [ruby](generators/ruby.md)
* [ruby-idiomatic (beta)](generators/ruby-idiomatic.md)
* [ruby-nextgen (beta)](generators/ruby-nextgen.md)
* [rust](generators/rust.md)
* [scala-akka](generators/scala-akka.md)
* [scala-gatling](generators/scala-gatling.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Documentation for the ruby-idiomatic Generator
title: Documentation for the ruby-nextgen Generator
---

## METADATA

| Property | Value | Notes |
| -------- | ----- | ----- |
| generator name | ruby-idiomatic | pass this to the generate command after -g |
| generator name | ruby-nextgen | pass this to the generate command after -g |
| generator stability | BETA | |
| generator type | CLIENT | |
| generator language | Ruby | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.swagger.v3.oas.models.*;
import io.swagger.v3.oas.models.media.Schema;
import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.rubyidiomatic.RubyApiRouting;
import org.openapitools.codegen.languages.rubynextgen.RubyApiRouting;
import org.openapitools.codegen.model.*;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
Expand All @@ -20,8 +20,8 @@
import static org.openapitools.codegen.utils.StringUtils.camelize;
import static org.openapitools.codegen.utils.StringUtils.underscore;

public class RubyIdiomaticClientCodegen extends AbstractRubyCodegen {
private final Logger LOGGER = LoggerFactory.getLogger(RubyIdiomaticClientCodegen.class);
public class RubyNextgenClientCodegen extends AbstractRubyCodegen {
private final Logger LOGGER = LoggerFactory.getLogger(RubyNextgenClientCodegen.class);

private static final String GEM_VERSION = "gemVersion";
private static final String GEM_VERSION_DESC = "gem version.";
Expand Down Expand Up @@ -80,7 +80,7 @@ public class RubyIdiomaticClientCodegen extends AbstractRubyCodegen {
// inflections for names whose acronym casing diverges from the default inflector.
private final java.util.LinkedHashMap<String, String> modelFileToClass = new java.util.LinkedHashMap<>();

public RubyIdiomaticClientCodegen() {
public RubyNextgenClientCodegen() {
super();
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.BETA)
Expand All @@ -106,12 +106,12 @@ public RubyIdiomaticClientCodegen() {
SecurityFeature.BearerToken
))
);
outputFolder = "generated-code" + File.separator + "ruby-idiomatic";
outputFolder = "generated-code" + File.separator + "ruby-nextgen";
modelTemplateFiles.put("model.mustache", ".rb");
apiTemplateFiles.put("api.mustache", ".rb");
modelTestTemplateFiles.put("model_test.mustache", ".rb");
apiTestTemplateFiles.put("api_test.mustache", ".rb");
embeddedTemplateDir = templateDir = "ruby-idiomatic";
embeddedTemplateDir = templateDir = "ruby-nextgen";
modelPackage = "models";
apiPackage = "api";
cliOptions.add(new CliOption(CodegenConstants.GEM_NAME, CodegenConstants.GEM_NAME_DESC));
Expand Down Expand Up @@ -276,7 +276,7 @@ public CodegenType getTag() {

@Override
public String getName() {
return "ruby-idiomatic";
return "ruby-nextgen";
}

@Override
Expand All @@ -292,12 +292,12 @@ public String getHelp() {
public String toOperationId(String operationId) {
if (operationId == null || operationId.isEmpty()) {
String renamed = "empty_method_name_" + emptyMethodNameCounter++;
LOGGER.warn("ruby-idiomatic: empty method name renamed to `{}`", renamed);
LOGGER.warn("ruby-nextgen: empty method name renamed to `{}`", renamed);
return renamed;
}
if (operationId.matches("^\\d.*")) {
String renamed = underscore("call_" + operationId);
LOGGER.warn("ruby-idiomatic: method name `{}` starts with a digit, renamed to `{}`", operationId, renamed);
LOGGER.warn("ruby-nextgen: method name `{}` starts with a digit, renamed to `{}`", operationId, renamed);
return renamed;
}
return super.toOperationId(operationId);
Expand Down Expand Up @@ -341,7 +341,7 @@ private String shortenModelName(String camelized) {
head = head.substring(0, head.length() - 1);
}
String shortened = head + suffix;
LOGGER.warn("ruby-idiomatic: model name too long for tar, shortened `{}` -> `{}`", camelized, shortened);
LOGGER.warn("ruby-nextgen: model name too long for tar, shortened `{}` -> `{}`", camelized, shortened);
return shortened;
}

Expand Down Expand Up @@ -518,7 +518,7 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
clash = uniqueClash(opList, unique);
}
if (!unique.equals(co.operationId)) {
LOGGER.warn("ruby-idiomatic: action collision, renamed `{}` -> `{}`", co.operationId, unique);
LOGGER.warn("ruby-nextgen: action collision, renamed `{}` -> `{}`", co.operationId, unique);
co.operationId = unique;
}
opList.add(co);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// RubyApiRouting.java
package org.openapitools.codegen.languages.rubyidiomatic;
package org.openapitools.codegen.languages.rubynextgen;

import java.util.*;
import org.openapitools.codegen.utils.StringUtils;

// NOTE: Intentional copy of CrystalApiRouting. The path->route logic is
// language-agnostic; it is duplicated (not shared) to keep each generator
// fully decoupled and avoid modifying the already-shipped Crystal generator.
/** Pure routing logic for the Ruby-idiomatic generator: path -> (namespace, resource, action). */
/** Pure routing logic for the ruby-nextgengenerator: path -> (namespace, resource, action). */

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: The class-level Javadoc comment has a typo: ruby-nextgengenerator is missing a space. It should read ruby-nextgen generator to match the original comment's readability.

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/rubynextgen/RubyApiRouting.java, line 10:

<comment>The class-level Javadoc comment has a typo: `ruby-nextgengenerator` is missing a space. It should read `ruby-nextgen generator` to match the original comment's readability.</comment>

<file context>
@@ -1,13 +1,13 @@
 // language-agnostic; it is duplicated (not shared) to keep each generator
 // fully decoupled and avoid modifying the already-shipped Crystal generator.
-/** Pure routing logic for the Ruby-idiomatic generator: path -> (namespace, resource, action). */
+/** Pure routing logic for the ruby-nextgengenerator: path -> (namespace, resource, action). */
 public final class RubyApiRouting {
     private RubyApiRouting() {}
</file context>
Suggested change
/** Pure routing logic for the ruby-nextgengenerator: path -> (namespace, resource, action). */
/** Pure routing logic for the ruby-nextgen generator: path -> (namespace, resource, action). */

public final class RubyApiRouting {
private RubyApiRouting() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen
org.openapitools.codegen.languages.PythonBluePlanetServerCodegen
org.openapitools.codegen.languages.RClientCodegen
org.openapitools.codegen.languages.RubyClientCodegen
org.openapitools.codegen.languages.RubyIdiomaticClientCodegen
org.openapitools.codegen.languages.RubyNextgenClientCodegen
org.openapitools.codegen.languages.RubyOnRailsServerCodegen
org.openapitools.codegen.languages.RubySinatraServerCodegen
org.openapitools.codegen.languages.RustAxumServerCodegen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.openapitools.codegen.rubyidiomatic;
package org.openapitools.codegen.rubynextgen;

import org.openapitools.codegen.languages.rubyidiomatic.RubyApiRouting;
import org.openapitools.codegen.languages.rubynextgen.RubyApiRouting;
import org.testng.annotations.Test;
import java.util.*;
import static org.testng.Assert.assertEquals;
Expand Down
Loading
Loading