From b5f0b24bae4623bfc2fc6792dce24bbcb214f39e Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 9 Apr 2018 12:41:36 +0800 Subject: [PATCH] fix object declaration in model --- bin/typescript-angular-v2-petstore.sh | 2 +- .../codegen/languages/TypeScriptAngularClientCodegen.java | 2 -- .../codegen/languages/TypeScriptFetchClientCodegen.java | 2 -- .../codegen/languages/TypeScriptInversifyClientCodegen.java | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/bin/typescript-angular-v2-petstore.sh b/bin/typescript-angular-v2-petstore.sh index ac9a2004a4b2..250217a4b785 100755 --- a/bin/typescript-angular-v2-petstore.sh +++ b/bin/typescript-angular-v2-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l typescript-angular -o samples/client/petstore/typescript-angular-v2/default --additional-properties ngVersion=2" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l typescript-angular -o samples/client/petstore/typescript-angular-v2/default --additional-properties ngVersion=2 $@" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 21ed141b5f70..3367fad76c95 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -176,8 +176,6 @@ public boolean isDataTypeFile(final String dataType) { public String getTypeDeclaration(Schema p) { if (p instanceof FileSchema) { return "Blob"; - } else if (!StringUtils.isEmpty(p.get$ref())) { - return "any"; } else { return super.getTypeDeclaration(p); } 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 b223a3bf45b4..fbc57d033ea6 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 @@ -107,8 +107,6 @@ public String getTypeDeclaration(Schema p) { return "any"; } else if (p instanceof BinarySchema) { return "any"; - } else if (!StringUtils.isEmpty(p.get$ref())) { // model - return "any"; } else { return super.getTypeDeclaration(p); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java index d701891bec15..eab76efc8e3f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptInversifyClientCodegen.java @@ -156,8 +156,6 @@ public boolean isDataTypeFile(final String dataType) { public String getTypeDeclaration(Schema p) { if (p instanceof FileSchema) { return "Blob"; - } else if (!StringUtils.isEmpty(p.get$ref())) { - return "any"; } else { return super.getTypeDeclaration(p); }