From 9f899c5e6d546bc1a17fb4f8ddb130f098fe9d0b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jan 2022 13:39:57 +0800 Subject: [PATCH] minor bug fixes in ts fetch generator (#11215) --- .../TypeScriptFetchClientCodegen.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index bc0a2808aad..5c810f7073b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -1064,6 +1064,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenParameter that = (ExtendedCodegenParameter) o; return result && @@ -1109,7 +1115,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege public ExtendedCodegenProperty(CodegenProperty cp) { super(); - this.openApiType = openApiType; + this.openApiType = cp.openApiType; this.baseName = cp.baseName; this.complexType = cp.complexType; this.getter = cp.getter; @@ -1200,6 +1206,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenProperty that = (ExtendedCodegenProperty) o; return result && @@ -1306,6 +1318,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenOperation that = (ExtendedCodegenOperation) o; return result && @@ -1440,6 +1458,12 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege @Override public boolean equals(Object o) { + if (o == null) + return false; + + if (this.getClass() != o.getClass()) + return false; + boolean result = super.equals(o); ExtendedCodegenModel that = (ExtendedCodegenModel) o; return result &&