From 9fadf0c289b10486079c75bd91d20bd667ffa609 Mon Sep 17 00:00:00 2001 From: dphuang2 Date: Fri, 23 Aug 2024 19:12:09 -0700 Subject: [PATCH] [ENG-2008] Generate Composio Ruby SDK (#778) * add composio-sdks * don't escape the pattern in Ruby SDK --- .gitmodules | 3 +++ customers/composio/composio-sdks | 1 + .../codegen/languages/AbstractRubyCodegen.java | 13 +++++++++++++ 3 files changed, 17 insertions(+) create mode 160000 customers/composio/composio-sdks diff --git a/.gitmodules b/.gitmodules index d43b14c826..68a8d0f722 100644 --- a/.gitmodules +++ b/.gitmodules @@ -142,3 +142,6 @@ [submodule "generator/konfig-AnyCodable"] path = generator/konfig-AnyCodable url = https://github.com/Flight-School/AnyCodable.git +[submodule "customers/composio/composio-sdks"] + path = customers/composio/composio-sdks + url = https://github.com/konfig-dev/composio-sdks.git diff --git a/customers/composio/composio-sdks b/customers/composio/composio-sdks new file mode 160000 index 0000000000..8bb5612a55 --- /dev/null +++ b/customers/composio/composio-sdks @@ -0,0 +1 @@ +Subproject commit 8bb5612a557ab2213d1faf616b117c31f33afde5 diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java index f1534e860a..79891b29ea 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java @@ -205,6 +205,19 @@ public String toRegularExpression(String pattern) { return addRegularExpressionDelimiter(pattern); } + @Override + public String addRegularExpressionDelimiter(String pattern) { + if (StringUtils.isEmpty(pattern)) { + return pattern; + } + + if (!pattern.matches("^/.*")) { + return "/" + pattern + "/"; + } + + return pattern; + } + @Override public String toParamName(String name) { // should be the same as variable name