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
9 changes: 0 additions & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,5 @@ module.exports = {
},
extends: ["plugin:json/recommended-legacy"]
},
{
files: ['templates/**/*.mustache'],

parser: 'eslint-plugin-automation-custom',
plugins: ['automation-custom'],
rules: {
'automation-custom/no-new-line': 'error',
},
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ JsonSerializerOptions options
switch (type)
{
case JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null && _stringToEnum.TryGetValue(stringValue, out var enumValue))
{
var stringValue = reader.GetString();
if (stringValue != null && _stringToEnum.TryGetValue(stringValue, out var enumValue))
{
return enumValue;
}

break;
}
case JsonTokenType.Number:
{
var numValue = reader.GetInt32();
_numberToEnum.TryGetValue(numValue, out var enumValue);
return enumValue;
}

break;
}
case JsonTokenType.Number:
{
var numValue = reader.GetInt32();
_numberToEnum.TryGetValue(numValue, out var enumValue);
return enumValue;
}
}

return default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ public static string ParameterToString(object obj)
case bool boolean:
return boolean ? "true" : "false";
case ICollection collection:
{
var entries = new List<string>();
foreach (var entry in collection)
entries.Add(ParameterToString(entry));
return string.Join(",", entries);
}
{
var entries = new List<string>();
foreach (var entry in collection)
entries.Add(ParameterToString(entry));
return string.Join(",", entries);
}
case Enum when HasEnumMemberAttrValue(obj):
return GetEnumMemberAttrValue(obj);
case AbstractSchema schema when obj.GetType().IsClass:
{
return ParameterToString(schema.ActualInstance);
}
{
return ParameterToString(schema.ActualInstance);
}
default:
return Convert.ToString(obj, CultureInfo.InvariantCulture);
}
Expand Down
8 changes: 6 additions & 2 deletions clients/algoliasearch-client-php/lib/FormDataProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://openapi-generator.tech
* Generator version: 7.14.0
* Generator version: 7.16.0
*/

/**
Expand Down Expand Up @@ -123,7 +123,11 @@ public static function flatten(array $source, string $start = ''): array
$currentName .= $currentSuffix;
}

$result[$currentName] = ObjectSerializer::toString($val);
if (is_resource($val)) {
$result[$currentName] = $val;
} else {
$result[$currentName] = ObjectSerializer::toString($val);
}
}

$currentName = $start;
Expand Down
2 changes: 0 additions & 2 deletions eslint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { endWithDot } from './rules/endWithDot.js';
import { hasType } from './rules/hasType.js';
import { noBigInt } from './rules/noBigInt.js';
import { noFinalDot } from './rules/noFinalDot.js';
import { noNewLine } from './rules/noNewLine.js';
import { createOutOfLineRule } from './rules/outOfLineRule.js';
import { refCommon } from './rules/refCommon.js';
import { singleQuoteRef } from './rules/singleQuoteRef.js';
Expand All @@ -14,7 +13,6 @@ const rules = {
'has-type': hasType,
'no-big-int': noBigInt,
'no-final-dot': noFinalDot,
'no-new-line': noNewLine,
'out-of-line-all-of': createOutOfLineRule({ property: 'allOf' }),
'out-of-line-any-of': createOutOfLineRule({ property: 'anyOf' }),
'out-of-line-enum': createOutOfLineRule({ property: 'enum' }),
Expand Down
35 changes: 0 additions & 35 deletions eslint/src/rules/noNewLine.ts

This file was deleted.

44 changes: 0 additions & 44 deletions eslint/tests/noNewLine.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion generators/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

dependencies {
compileOnly 'org.openapitools:openapi-generator:7.14.0'
compileOnly 'org.openapitools:openapi-generator:7.16.0'
}

tasks.withType(JavaCompile) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"cli": "yarn workspace scripts start",
"docker:setup": "./scripts/docker/setup.sh",
"fix:json": "eslint --ext=json . --fix",
"fix:mustache": "eslint --ext=mustache templates/**/tests/ --fix",
"github-actions:lint": "eslint --ext=yml .github/",
"postinstall": "husky && yarn workspace eslint-plugin-automation-custom build",
"playground:browser": "yarn workspace javascript-browser-playground start",
Expand All @@ -31,7 +30,7 @@
"website:build": "bash scripts/website/build.sh"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "2.22.0",
"@openapitools/openapi-generator-cli": "2.24.0",
"@redocly/cli": "1.29.0",
"eslint": "8.57.1",
"eslint-plugin-automation-custom": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/cts/testServer/timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function assertValidTimeouts(expectedCount: number): void {
switch (lang) {
case 'csharp':
case 'swift':
// csharp and swift clocks are worse than my childhood mickey mouse watch
// csharp and swift clocks are worse than my childhood mickey mouse watch
expect(state.duration[3 * i]).to.be.closeTo(state.duration[3 * i + 1], 800);
break;
case 'javascript':
Expand Down
6 changes: 5 additions & 1 deletion scripts/pre-gen/generateOpenapitools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export async function generateOpenapitools(
mode,
...additionalProperties,
},
'openapi-normalizer': {
// if this is set to true, it causes a breaking change on PlatformWithNone, this can be removed in the next major
SIMPLIFY_ONEOF_ANYOF_ENUM: false,
},
};
}

Expand All @@ -43,7 +47,7 @@ export async function generateOpenapitools(
JSON.stringify(
{
'generator-cli': {
version: '7.14.0',
version: '7.16.0',
generators,
},
},
Expand Down
2 changes: 1 addition & 1 deletion templates/csharp/snippets/import.mustache
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using Algolia.Search.Clients;
using Algolia.Search.Http;
using Algolia.Search.Models.{{clientPrefix}};
using Algolia.Search.Models.{{clientPrefix}};
2 changes: 1 addition & 1 deletion templates/csharp/snippets/init.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var client = new {{client}}(new {{clientPrefix}}Config("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}},"ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}));
var client = new {{client}}(new {{clientPrefix}}Config("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}},"ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}}));
2 changes: 1 addition & 1 deletion templates/dart/snippets/import.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import '{{{import}}}';
import '{{{import}}}';
2 changes: 1 addition & 1 deletion templates/dart/snippets/init.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
final client = {{client}}(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'{{#hasRegionalHost}}, region: 'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}});
final client = {{client}}(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY'{{#hasRegionalHost}}, region: 'ALGOLIA_APPLICATION_REGION'{{/hasRegionalHost}});
2 changes: 1 addition & 1 deletion templates/go/operation_description.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Request can be constructed by NewApi{{operationId}}Request with parameters below

Deprecated
{{/isDeprecated}}
*/
*/
2 changes: 1 addition & 1 deletion templates/go/snippets/import.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "github.com/algolia/algoliasearch-client-go/v4/algolia/{{clientImport}}"
import "github.com/algolia/algoliasearch-client-go/v4/algolia/{{clientImport}}"
2 changes: 1 addition & 1 deletion templates/go/snippets/init.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ client, err := {{clientPrefix}}.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
}
2 changes: 1 addition & 1 deletion templates/java/snippets/import.mustache
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import com.algolia.api.{{client}};
import com.algolia.model.{{import}}.*;
import com.algolia.config.*;
import com.algolia.config.*;
2 changes: 1 addition & 1 deletion templates/java/snippets/init.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{client}} client = new {{client}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}});
{{client}} client = new {{client}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}});
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,4 @@ export function algoliasearch(

{{/dependencies}}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ export type InitClientOptions = Partial<{
*/
apiKey: string;
options: ClientOptions;
}>;
}>;
2 changes: 1 addition & 1 deletion templates/javascript/clients/client/api/helpers.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -513,4 +513,4 @@ searchForFacets(
requestOptions?: RequestOptions | undefined
): Promise<{results: Array<SearchForFacetValuesResponse>}> {
return this.search(searchMethodParams, requestOptions) as Promise<{results: Array<SearchForFacetValuesResponse>}>;
},
},
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ async chunkedPush(
}

return responses;
},
},
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ async accountCopyIndex(
for (const response of responses) {
await destinationClient.waitForTask({ indexName: destinationIndexName, taskID: response.taskID });
}
},
},
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
{{/x-is-single-body-param}}
{{/vendorExtensions}}
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
*/
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ type LegacySearchQuery = LegacySearchForFacets | LegacySearchForHits;
*
* @deprecated This signature will be removed from the next major version, we recommend using the `SearchMethodParams` type for performances and future proof reasons.
*/
export type LegacySearchMethodProps = LegacySearchQuery[];
export type LegacySearchMethodProps = LegacySearchQuery[];
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ getSecuredApiKeyRemainingValidity: ({
}

return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000);
},
},
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ generateSecuredApiKey: async ({

const queryParameters = serializeQueryParameters(mergedRestrictions);
return await generateBase64Hmac(parentApiKey, queryParameters);
},
},
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
});
}

export type {{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}} = ReturnType<typeof create{{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}}>;
export type {{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}} = ReturnType<typeof create{{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}}>;
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ export function {{clientName}}(
if ({{^fallbackToAliasHost}}!region || {{/fallbackToAliasHost}}(region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
throw new Error(`\`region\` {{^fallbackToAliasHost}}is required and {{/fallbackToAliasHost}}must be one of the following: ${REGIONS.join(', ')}`);
}
{{/hasRegionalHost}}

{{/hasRegionalHost}}
2 changes: 1 addition & 1 deletion templates/javascript/clients/client/builds/node.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ import { createHmac } from 'node:crypto';
{{> client/api/searchHelpers}}
{{/searchHelpers}}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ async function generateBase64Hmac(parentApiKey: string, queryParameters: string)
const combined = hmacHex + queryParameters;
return btoa(combined);
}
{{/searchHelpers}}
{{/searchHelpers}}
2 changes: 1 addition & 1 deletion templates/javascript/snippets/import.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import { {{clientName}} } from '{{{importPackage}}}';
import { {{clientName}} } from '{{{importPackage}}}';
2 changes: 1 addition & 1 deletion templates/javascript/snippets/init.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const client = {{{clientName}}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#isStandaloneClient}}{{#hasRegionalHost}}, '{{defaultRegion}}' {{/hasRegionalHost}}{{/isStandaloneClient}}){{^isStandaloneClient}}.{{{initMethod}}}({{#hasRegionalHost}} {region: '{{defaultRegion}}'} {{/hasRegionalHost}}){{/isStandaloneClient}};
const client = {{{clientName}}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#isStandaloneClient}}{{#hasRegionalHost}}, '{{defaultRegion}}' {{/hasRegionalHost}}{{/isStandaloneClient}}){{^isStandaloneClient}}.{{{initMethod}}}({{#hasRegionalHost}} {region: '{{defaultRegion}}'} {{/hasRegionalHost}}){{/isStandaloneClient}};
Loading