Skip to content

Commit 5b7ed99

Browse files
authored
chore(all): upgrade openapi-generator to v6.4.0 (#1360)
1 parent 7630fe7 commit 5b7ed99

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed

config/openapitools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"generator-cli": {
3-
"version": "6.0.1",
3+
"version": "6.4.0",
44
"generators": {
55
"javascript-algoliasearch": {
66
"output": "#{cwd}/clients/algoliasearch-client-javascript/packages/algoliasearch",

generators/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repositories {
1212
}
1313

1414
dependencies {
15-
compileOnly 'org.openapitools:openapi-generator:6.0.1'
15+
compileOnly 'org.openapitools:openapi-generator:6.4.0'
1616
compileOnly 'org.yaml:snakeyaml:1.32'
1717
}
1818

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"website:build-specs": "BUNDLE_WITH_DOC=true DOCKER=true yarn cli build specs all -s"
3232
},
3333
"devDependencies": {
34-
"@openapitools/openapi-generator-cli": "2.5.1",
34+
"@openapitools/openapi-generator-cli": "2.5.2",
3535
"@prettier/plugin-php": "0.19.3",
3636
"@redocly/openapi-cli": "1.0.0-beta.95",
3737
"@typescript-eslint/eslint-plugin": "5.53.0",

scripts/cts/generate.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { buildCustomGenerators, run, toAbsolutePath } from '../common';
1+
import { buildSpecs } from '../buildSpecs';
2+
import { buildCustomGenerators, CI, run, toAbsolutePath } from '../common';
23
import { getTestOutputFolder } from '../config';
34
import { formatter } from '../formatter';
45
import { createSpinner } from '../oraLog';
@@ -22,8 +23,13 @@ export async function ctsGenerateMany(
2223
generators: Generator[],
2324
verbose: boolean
2425
): Promise<void> {
25-
await buildCustomGenerators(verbose);
26+
if (!CI) {
27+
const clients = [...new Set(generators.map((gen) => gen.client))];
28+
await buildSpecs(clients, 'yml', verbose, true);
29+
}
30+
2631
await generateOpenapitools(generators);
32+
await buildCustomGenerators(verbose);
2733

2834
for (const gen of generators) {
2935
if (!getTestOutputFolder(gen.language)) {

templates/java/pojo.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public {{classname}} setAdditionalProperty(String name, Object value) {
5555
public {{classname}} add{{nameInCamelCase}}({{#vendorExtensions.x-has-child-generic}}{{{complexType}}}<T>{{/vendorExtensions.x-has-child-generic}}{{^vendorExtensions.x-has-child-generic}}{{#items}}{{> generic_type}}{{/items}}{{/vendorExtensions.x-has-child-generic}} {{name}}Item) {
5656
{{^required}}
5757
if (this.{{name}} == null) {
58-
this.{{name}} = {{{defaultValue}}};
58+
this.{{name}} = new ArrayList<>();
5959
}
6060
{{/required}}
6161
this.{{name}}.add({{name}}Item);
@@ -66,7 +66,7 @@ public {{classname}} setAdditionalProperty(String name, Object value) {
6666
public {{classname}} put{{nameInCamelCase}}(String key, {{#items}}{{> generic_type}}{{/items}} {{name}}Item) {
6767
{{^required}}
6868
if (this.{{name}} == null) {
69-
this.{{name}} = {{{defaultValue}}};
69+
this.{{name}} = new HashMap<>();
7070
}
7171
{{/required}}
7272
this.{{name}}.put(key, {{name}}Item);

templates/javascript/clients/model.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
{{#tsImports}}
55
import { {{classname}} } from '{{filename}}';
66
{{/tsImports}}
7+
{{#interfaces.size}}{{#composedSchemas.allOf}}
8+
import type { {{{dataType}}} } from './{{#lambda.camelcase}}{{{dataType}}}{{/lambda.camelcase}}';
9+
{{/composedSchemas.allOf}}{{/interfaces.size}}
710

811
{{! We handle types that depend on other interfaces }}
912
{{#interfaces.size}}

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ __metadata:
2828
version: 0.0.0-use.local
2929
resolution: "@algolia/api-client-automation@workspace:."
3030
dependencies:
31-
"@openapitools/openapi-generator-cli": 2.5.1
31+
"@openapitools/openapi-generator-cli": 2.5.2
3232
"@prettier/plugin-php": 0.19.3
3333
"@redocly/openapi-cli": 1.0.0-beta.95
3434
"@typescript-eslint/eslint-plugin": 5.53.0
@@ -1309,9 +1309,9 @@ __metadata:
13091309
languageName: node
13101310
linkType: hard
13111311

1312-
"@openapitools/openapi-generator-cli@npm:2.5.1":
1313-
version: 2.5.1
1314-
resolution: "@openapitools/openapi-generator-cli@npm:2.5.1"
1312+
"@openapitools/openapi-generator-cli@npm:2.5.2":
1313+
version: 2.5.2
1314+
resolution: "@openapitools/openapi-generator-cli@npm:2.5.2"
13151315
dependencies:
13161316
"@nestjs/common": 8.4.4
13171317
"@nestjs/core": 8.4.4
@@ -1330,7 +1330,7 @@ __metadata:
13301330
tslib: 2.0.3
13311331
bin:
13321332
openapi-generator-cli: main.js
1333-
checksum: 9d5df24f950d2e1a4ae5a34deb0c2a4744ec58747b93a2a05e5230b25a21817b9acbc770e0513fcaa74901c64648477e5401ae440345ae285748c57879305897
1333+
checksum: 77a77be03877311b55c8a749646cebd6a1e330eb5c2edf64695b20ae575c3cd8c6c316d2099866f7a9ed9fe545847472f4ec44aab133d76b707c085e77b70605
13341334
languageName: node
13351335
linkType: hard
13361336

0 commit comments

Comments
 (0)