Skip to content

chore(all): upgrade openapi-generator to v6.4.0 #1360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2023
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
2 changes: 1 addition & 1 deletion config/openapitools.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"generator-cli": {
"version": "6.0.1",
"version": "6.4.0",
"generators": {
"javascript-algoliasearch": {
"output": "#{cwd}/clients/algoliasearch-client-javascript/packages/algoliasearch",
Expand Down
2 changes: 1 addition & 1 deletion generators/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

dependencies {
compileOnly 'org.openapitools:openapi-generator:6.0.1'
compileOnly 'org.openapitools:openapi-generator:6.4.0'
compileOnly 'org.yaml:snakeyaml:1.32'
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"website:build-specs": "BUNDLE_WITH_DOC=true DOCKER=true yarn cli build specs all -s"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "2.5.1",
"@openapitools/openapi-generator-cli": "2.5.2",
"@prettier/plugin-php": "0.19.3",
"@redocly/openapi-cli": "1.0.0-beta.95",
"@typescript-eslint/eslint-plugin": "5.53.0",
Expand Down
10 changes: 8 additions & 2 deletions scripts/cts/generate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { buildCustomGenerators, run, toAbsolutePath } from '../common';
import { buildSpecs } from '../buildSpecs';
import { buildCustomGenerators, CI, run, toAbsolutePath } from '../common';
import { getTestOutputFolder } from '../config';
import { formatter } from '../formatter';
import { createSpinner } from '../oraLog';
Expand All @@ -22,8 +23,13 @@ export async function ctsGenerateMany(
generators: Generator[],
verbose: boolean
): Promise<void> {
await buildCustomGenerators(verbose);
if (!CI) {
const clients = [...new Set(generators.map((gen) => gen.client))];
await buildSpecs(clients, 'yml', verbose, true);
}

await generateOpenapitools(generators);
await buildCustomGenerators(verbose);

for (const gen of generators) {
if (!getTestOutputFolder(gen.language)) {
Expand Down
4 changes: 2 additions & 2 deletions templates/java/pojo.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public {{classname}} setAdditionalProperty(String name, Object value) {
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) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = new ArrayList<>();
}
{{/required}}
this.{{name}}.add({{name}}Item);
Expand All @@ -66,7 +66,7 @@ public {{classname}} setAdditionalProperty(String name, Object value) {
public {{classname}} put{{nameInCamelCase}}(String key, {{#items}}{{> generic_type}}{{/items}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = new HashMap<>();
}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
Expand Down
3 changes: 3 additions & 0 deletions templates/javascript/clients/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
{{#tsImports}}
import { {{classname}} } from '{{filename}}';
{{/tsImports}}
{{#interfaces.size}}{{#composedSchemas.allOf}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l o v e l y

import type { {{{dataType}}} } from './{{#lambda.camelcase}}{{{dataType}}}{{/lambda.camelcase}}';
{{/composedSchemas.allOf}}{{/interfaces.size}}

{{! We handle types that depend on other interfaces }}
{{#interfaces.size}}
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@algolia/api-client-automation@workspace:."
dependencies:
"@openapitools/openapi-generator-cli": 2.5.1
"@openapitools/openapi-generator-cli": 2.5.2
"@prettier/plugin-php": 0.19.3
"@redocly/openapi-cli": 1.0.0-beta.95
"@typescript-eslint/eslint-plugin": 5.53.0
Expand Down Expand Up @@ -1309,9 +1309,9 @@ __metadata:
languageName: node
linkType: hard

"@openapitools/openapi-generator-cli@npm:2.5.1":
version: 2.5.1
resolution: "@openapitools/openapi-generator-cli@npm:2.5.1"
"@openapitools/openapi-generator-cli@npm:2.5.2":
version: 2.5.2
resolution: "@openapitools/openapi-generator-cli@npm:2.5.2"
dependencies:
"@nestjs/common": 8.4.4
"@nestjs/core": 8.4.4
Expand All @@ -1330,7 +1330,7 @@ __metadata:
tslib: 2.0.3
bin:
openapi-generator-cli: main.js
checksum: 9d5df24f950d2e1a4ae5a34deb0c2a4744ec58747b93a2a05e5230b25a21817b9acbc770e0513fcaa74901c64648477e5401ae440345ae285748c57879305897
checksum: 77a77be03877311b55c8a749646cebd6a1e330eb5c2edf64695b20ae575c3cd8c6c316d2099866f7a9ed9fe545847472f4ec44aab133d76b707c085e77b70605
languageName: node
linkType: hard

Expand Down