diff --git a/.github/.cache_version b/.github/.cache_version index 21e8796a09..ee90284c27 100644 --- a/.github/.cache_version +++ b/.github/.cache_version @@ -1 +1 @@ -1.0.3 +1.0.4 diff --git a/config/openapitools.json b/config/openapitools.json index 32d03d0ea9..08ee10f782 100644 --- a/config/openapitools.json +++ b/config/openapitools.json @@ -3,16 +3,13 @@ "version": "7.2.0", "generators": { "javascript-algoliasearch": { - "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/algoliasearch", - "reservedWordsMappings": "queryParameters=queryParameters,requestOptions=requestOptions,delete=delete" + "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/algoliasearch" }, "javascript-search": { - "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/client-search", - "reservedWordsMappings": "queryParameters=queryParameters,requestOptions=requestOptions,delete=delete" + "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/client-search" }, "javascript-recommend": { - "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/recommend", - "reservedWordsMappings": "queryParameters=queryParameters,delete=delete" + "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/recommend" }, "javascript-personalization": { "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/client-personalization" @@ -56,6 +53,9 @@ "java-query-suggestions": { "output": "#{cwd}/clients/algoliasearch-client-java" }, + "java-ingestion": { + "output": "#{cwd}/clients/algoliasearch-client-java" + }, "java-monitoring": { "output": "#{cwd}/clients/algoliasearch-client-java" }, @@ -80,56 +80,38 @@ "php-query-suggestions": { "output": "#{cwd}/clients/algoliasearch-client-php" }, + "php-ingestion": { + "output": "#{cwd}/clients/algoliasearch-client-php" + }, "php-monitoring": { "output": "#{cwd}/clients/algoliasearch-client-php" }, "go-analytics": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "analytics" - } + "output": "#{cwd}/clients/algoliasearch-client-go" + }, + "go-abtesting": { + "output": "#{cwd}/clients/algoliasearch-client-go" }, "go-ingestion": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "ingestion" - } + "output": "#{cwd}/clients/algoliasearch-client-go" }, "go-insights": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "insights" - } + "output": "#{cwd}/clients/algoliasearch-client-go" }, "go-query-suggestions": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "suggestions" - } + "output": "#{cwd}/clients/algoliasearch-client-go" }, "go-personalization": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "personalization" - } + "output": "#{cwd}/clients/algoliasearch-client-go" }, "go-recommend": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "recommend" - } + "output": "#{cwd}/clients/algoliasearch-client-go" }, "go-search": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "search" - } + "output": "#{cwd}/clients/algoliasearch-client-go" }, "go-monitoring": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "monitoring" - } + "output": "#{cwd}/clients/algoliasearch-client-go" }, "kotlin-search": { "output": "#{cwd}/clients/algoliasearch-client-kotlin" diff --git a/generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java b/generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java index d9f112aec8..486d6daa95 100644 --- a/generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java +++ b/generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java @@ -23,6 +23,8 @@ public String getName() { @Override public void processOpts() { String client = (String) additionalProperties.get("client"); + + additionalProperties.put("packageName", client.equals("query-suggestions") ? "suggestions" : client); additionalProperties.put("enumClassPrefix", true); additionalProperties.put("isSearchClient", client.equals("search")); diff --git a/generators/src/main/java/com/algolia/codegen/AlgoliaJavascriptGenerator.java b/generators/src/main/java/com/algolia/codegen/AlgoliaJavascriptGenerator.java index 44fc1c5f39..f5573a5d8b 100644 --- a/generators/src/main/java/com/algolia/codegen/AlgoliaJavascriptGenerator.java +++ b/generators/src/main/java/com/algolia/codegen/AlgoliaJavascriptGenerator.java @@ -36,6 +36,9 @@ public void processOpts() { setSupportsES6(true); setModelPropertyNaming("original"); setApiPackage("src"); + reservedWordsMappings.put("queryParameters", "queryParameters"); + reservedWordsMappings.put("requestOptions", "requestOptions"); + reservedWordsMappings.put("delete", "delete"); // Generation notice, added on every generated files Helpers.setGenerationBanner(additionalProperties); diff --git a/templates/java/tests/generateParams.mustache b/templates/java/tests/generateParams.mustache index 1575340eb5..1e2f942dfe 100644 --- a/templates/java/tests/generateParams.mustache +++ b/templates/java/tests/generateParams.mustache @@ -25,7 +25,7 @@ {{#isObject}} {{{objectName}}} {{{key}}}{{suffix}} = new {{{objectName}}}(); { - {{#value}}{{> generateParams}}{{#isAdditionalProperty}}{{parent}}{{parentSuffix}}.setAdditionalProperty("{{{key}}}", {{> maybeConvertOneOf}});{{/isAdditionalProperty}}{{^isAdditionalProperty}}{{parent}}{{parentSuffix}}.set{{#lambda.titlecase}}{{{key}}}{{/lambda.titlecase}}({{> maybeConvertOneOf}});{{/isAdditionalProperty}}{{/value}} + {{#value}}{{> generateParams}}{{#isAdditionalProperty}}{{parent}}{{parentSuffix}}.setAdditionalProperty("{{{key}}}", {{> maybeConvertOneOf}});{{/isAdditionalProperty}}{{^isAdditionalProperty}}{{parent}}{{parentSuffix}}.set{{#lambda.pascalcase}}{{{key}}}{{/lambda.pascalcase}}({{> maybeConvertOneOf}});{{/isAdditionalProperty}}{{/value}} } {{/isObject}} {{#isFreeFormObject}}