diff --git a/packages/java/fusion-endpoint/pom.xml b/packages/java/fusion-endpoint/pom.xml
index c61b2493..c20c4b91 100644
--- a/packages/java/fusion-endpoint/pom.xml
+++ b/packages/java/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/packages/java/fusion-endpoint/src/main/java/com/vaadin/fusion/generator/typescript/CodeGenerator.java b/packages/java/fusion-endpoint/src/main/java/com/vaadin/fusion/generator/typescript/CodeGenerator.java
index df261094..35f7f4ff 100644
--- a/packages/java/fusion-endpoint/src/main/java/com/vaadin/fusion/generator/typescript/CodeGenerator.java
+++ b/packages/java/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/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.ArraySchema.ts b/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.ArraySchema.ts
index dd83ae2a..9c65b518 100644
--- a/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.ArraySchema.ts
+++ b/packages/java/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/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.Schema.ts b/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.Schema.ts
index 23d9abb1..5984f0e6 100644
--- a/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/endpoints/inheritedmodel/expected-model-media.Schema.ts
+++ b/packages/java/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/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiple-tags-operation.json b/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiple-tags-operation.json
index 31cd5609..c2b5a485 100644
--- a/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiple-tags-operation.json
+++ b/packages/java/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/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiplelines-description.json b/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiplelines-description.json
index c0fb9a40..d7d47915 100644
--- a/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/multiplelines-description.json
+++ b/packages/java/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/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/no-tag-operation.json b/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/no-tag-operation.json
index c39e3985..e1c22c3b 100644
--- a/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/no-tag-operation.json
+++ b/packages/java/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/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/parameters-and-return-tsdoc.json b/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/parameters-and-return-tsdoc.json
index 5429778c..f977b71e 100644
--- a/packages/java/fusion-endpoint/src/test/resources/com/vaadin/fusion/generator/openapi/parameters-and-return-tsdoc.json
+++ b/packages/java/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" : {