From 1bf109c6fa95e158dbecf64b69da7a43f35121b4 Mon Sep 17 00:00:00 2001 From: Artem Godin Date: Mon, 6 Sep 2021 13:08:35 +0300 Subject: [PATCH] chore(deps): bump swagger-codegen to 3.0.27 (#11743) * Bump swagger-codegen to 3.0.27 * Fix formatting * Fix formatting * chore(deps): bump jetty.version (#11722) Bumps `jetty.version` from 9.4.27.v20200227 to 9.4.43.v20210629. Updates `jetty-maven-plugin` from 9.4.27.v20200227 to 9.4.43.v20210629 - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.27.v20200227...jetty-9.4.43.v20210629) Updates `jetty-webapp` from 9.4.27.v20200227 to 9.4.43.v20210629 - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.27.v20200227...jetty-9.4.43.v20210629) Updates `jetty-continuation` from 9.4.27.v20200227 to 9.4.43.v20210629 Updates `jetty-annotations` from 9.4.27.v20200227 to 9.4.43.v20210629 - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.27.v20200227...jetty-9.4.43.v20210629) Updates `websocket-server` from 9.4.27.v20200227 to 9.4.43.v20210629 --- updated-dependencies: - dependency-name: org.eclipse.jetty:jetty-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.jetty:jetty-webapp dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.jetty:jetty-continuation dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.jetty:jetty-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.eclipse.jetty.websocket:websocket-server dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump maven-clean-plugin from 3.0.0 to 3.1.0 (#11728) Bumps [maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/apache/maven-clean-plugin/releases) - [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.0.0...maven-clean-plugin-3.1.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-clean-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump equalsverifier from 3.0 to 3.7.1 (#11723) Bumps [equalsverifier](https://github.com/jqno/equalsverifier) from 3.0 to 3.7.1. - [Release notes](https://github.com/jqno/equalsverifier/releases) - [Changelog](https://github.com/jqno/equalsverifier/blob/main/CHANGELOG.md) - [Commits](https://github.com/jqno/equalsverifier/compare/equalsverifier-3.0...equalsverifier-3.7.1) --- updated-dependencies: - dependency-name: nl.jqno.equalsverifier:equalsverifier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump maven-enforcer-plugin from 1.4.1 to 3.0.0 (#11724) Bumps [maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 1.4.1 to 3.0.0. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-1.4.1...enforcer-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump exec-maven-plugin from 1.6.0 to 3.0.0 (#11727) Bumps [exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 1.6.0 to 3.0.0. - [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases) - [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/exec-maven-plugin-1.6.0...exec-maven-plugin-3.0.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:exec-maven-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump maven-dependency-plugin from 2.8 to 3.2.0 (#11738) Bumps [maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) from 2.8 to 3.2.0. - [Release notes](https://github.com/apache/maven-dependency-plugin/releases) - [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-2.8...maven-dependency-plugin-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-dependency-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump validation-api from 2.0.0.Final to 2.0.1.Final (#11735) Bumps [validation-api](https://github.com/beanvalidation/beanvalidation-api) from 2.0.0.Final to 2.0.1.Final. - [Release notes](https://github.com/beanvalidation/beanvalidation-api/releases) - [Commits](https://github.com/beanvalidation/beanvalidation-api/compare/2.0.0.Final...2.0.1.Final) --- updated-dependencies: - dependency-name: javax.validation:validation-api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump hsqldb from 2.2.6 to 2.6.0 (#11737) Bumps hsqldb from 2.2.6 to 2.6.0. --- updated-dependencies: - dependency-name: org.hsqldb:hsqldb dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump mockito-core from 3.10.0 to 3.12.4 (#11733) Bumps [mockito-core](https://github.com/mockito/mockito) from 3.10.0 to 3.12.4. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v3.10.0...v3.12.4) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: organize dependency versions and update vulnerable jackson-databind version for fusion-endpoint (#11659) * Organize dependency versions * Retrigger validation * Update tests to reflect changes in FasterXML/jackson-databind#2643 * chore(deps): Override frontend-plugin-core dependencies (#11732) This overrides outdated and vulnerable jackson-databind and httpclient with a more recent yet compatible versions. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- fusion-endpoint/pom.xml | 4 +-- .../generator/typescript/CodeGenerator.java | 15 +++++----- .../expected-model-media.ArraySchema.ts | 1 - .../expected-model-media.Schema.ts | 1 + .../openapi/multiple-tags-operation.json | 30 +++++++++++++++++++ .../openapi/multiplelines-description.json | 30 +++++++++++++++++++ .../generator/openapi/no-tag-operation.json | 30 +++++++++++++++++++ .../openapi/parameters-and-return-tsdoc.json | 24 +++++++++++++++ 8 files changed, 125 insertions(+), 10 deletions(-) diff --git a/fusion-endpoint/pom.xml b/fusion-endpoint/pom.xml index c61b249348e..c20c4b91dbc 100644 --- a/fusion-endpoint/pom.xml +++ b/fusion-endpoint/pom.xml @@ -16,8 +16,8 @@ 2.2.0.RELEASE 1.3.2 3.23.0 - 3.0.2 - 1.0.2 + 3.0.27 + 1.0.27 diff --git a/fusion-endpoint/src/main/java/com/vaadin/fusion/generator/typescript/CodeGenerator.java b/fusion-endpoint/src/main/java/com/vaadin/fusion/generator/typescript/CodeGenerator.java index df261094e62..35f7f4ffa03 100644 --- a/fusion-endpoint/src/main/java/com/vaadin/fusion/generator/typescript/CodeGenerator.java +++ b/fusion-endpoint/src/main/java/com/vaadin/fusion/generator/typescript/CodeGenerator.java @@ -42,6 +42,7 @@ import io.swagger.codegen.v3.CodegenType; import io.swagger.codegen.v3.DefaultGenerator; import io.swagger.codegen.v3.generators.typescript.AbstractTypeScriptClientCodegen; +import io.swagger.codegen.v3.generators.util.OpenAPIUtil; import io.swagger.util.Json; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; @@ -229,10 +230,10 @@ public CodegenOperation fromOperation(String path, String httpMethod, @Override @SuppressWarnings("unchecked") - public CodegenParameter fromRequestBody(RequestBody body, - Map schemas, Set imports) { - CodegenParameter codegenParameter = super.fromRequestBody(body, schemas, - imports); + public CodegenParameter fromRequestBody(RequestBody body, String name, + Schema schema, Map schemas, Set imports) { + CodegenParameter codegenParameter = super.fromRequestBody(body, name, + schema, schemas, imports); Schema requestBodySchema = getRequestBodySchema(body); if (requestBodySchema != null) { imports.addAll(collectImportsFromSchema(requestBodySchema)); @@ -304,7 +305,7 @@ public String getTypeDeclaration(Schema schema) { return String.format("ReadonlyArray<%s>%s", this.getTypeDeclaration(inner), optionalSuffix); } else if (GeneratorUtils.isNotBlank(schema.get$ref())) { - return getSimpleRef(schema.get$ref()) + optionalSuffix; + return OpenAPIUtil.getSimpleRef(schema.get$ref()) + optionalSuffix; } else if (schema.getAdditionalProperties() != null) { Schema inner = (Schema) schema.getAdditionalProperties(); return String.format("Readonly>%s", @@ -417,7 +418,7 @@ public String toModelName(String name) { } @Override - protected void addImport(CodegenModel m, String type) { + public void addImport(CodegenModel m, String type) { if (!Objects.equals(m.getName(), type)) { super.addImport(m, type); } @@ -486,7 +487,7 @@ private void adjustImportInformationForModel( private Set collectImportsFromSchema(Schema schema) { Set imports = new HashSet<>(); if (GeneratorUtils.isNotBlank(schema.get$ref())) { - imports.add(getSimpleRef(schema.get$ref())); + imports.add(OpenAPIUtil.getSimpleRef(schema.get$ref())); } if (schema instanceof ArraySchema) { imports.addAll(collectImportsFromSchema( diff --git a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.ArraySchema.ts b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.ArraySchema.ts index dd83ae2a99c..9c65b518262 100644 --- a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.ArraySchema.ts +++ b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.ArraySchema.ts @@ -5,6 +5,5 @@ import Schema from './Schema'; * All changes to this file are overridden. Please consider to make changes in the corresponding Java file if necessary. */ export default interface ArraySchema extends Schema { - readonly type?: string; readonly items?: Schema; } \ No newline at end of file diff --git a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.Schema.ts b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.Schema.ts index 23d9abb18db..5984f0e602d 100644 --- a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.Schema.ts +++ b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.Schema.ts @@ -40,4 +40,5 @@ export default interface Schema { readonly extensions?: Readonly>; readonly _enum?: ReadonlyArray; readonly discriminator?: Discriminator; + readonly exampleSetFlag: boolean; } \ No newline at end of file diff --git a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiple-tags-operation.json b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiple-tags-operation.json index 31cd56090c3..c2b5a48572c 100644 --- a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiple-tags-operation.json +++ b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiple-tags-operation.json @@ -37,5 +37,35 @@ } } } + }, + "components" : { + "schemas" : { + "Role" : { + "type" : "object", + "properties" : { + "roleName" : { + "type" : "string" + } + }, + "description" : "Role bean" + }, + "User" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "roles" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Role" + } + } + } + } + } } } diff --git a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiplelines-description.json b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiplelines-description.json index c0fb9a400ef..d7d4791540a 100644 --- a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiplelines-description.json +++ b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiplelines-description.json @@ -37,5 +37,35 @@ } } } + }, + "components" : { + "schemas" : { + "Role" : { + "type" : "object", + "properties" : { + "roleName" : { + "type" : "string" + } + }, + "description" : "Role bean" + }, + "User" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "roles" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Role" + } + } + } + } + } } } diff --git a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/no-tag-operation.json b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/no-tag-operation.json index c39e398523b..e1c22c3b79c 100644 --- a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/no-tag-operation.json +++ b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/no-tag-operation.json @@ -36,5 +36,35 @@ } } } + }, + "components" : { + "schemas" : { + "Role" : { + "type" : "object", + "properties" : { + "roleName" : { + "type" : "string" + } + }, + "description" : "Role bean" + }, + "User" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "roles" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Role" + } + } + } + } + } } } diff --git a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/parameters-and-return-tsdoc.json b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/parameters-and-return-tsdoc.json index 5429778c454..f977b71ec2e 100644 --- a/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/parameters-and-return-tsdoc.json +++ b/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/parameters-and-return-tsdoc.json @@ -75,6 +75,30 @@ } } } + }, + "ComplexRequest" : { + "type" : "object", + "properties" : { + "valueA" : { + "type" : "string" + }, + "valueB" : { + "type" : "string" + } + }, + "description" : "ComplexRequest bean" + }, + "ComplexResponse" : { + "type" : "object", + "properties" : { + "valueC" : { + "type" : "string" + }, + "valueD" : { + "type" : "string" + } + }, + "description" : "ComplexResponse bean" } }, "securitySchemes" : {