From 947b0d96c99288766bcabb3dc6d7aa692efdc707 Mon Sep 17 00:00:00 2001 From: topce Date: Sat, 27 Oct 2018 08:27:52 +0200 Subject: [PATCH] Fix angular 7 compile problem (#1297) * fix wrong formParams type * run typescript-angular-petstore-all.bat * more typesafe fix * fix formatting * run typescript-angular-petstore-all.bat * fix compile problem with previous versions of angular * generate code * fix compile problem add * try Johannes Hoppe solution * generate files --- .../main/resources/typescript-angular/api.service.mustache | 2 +- .../petstore/typescript-angular-v2/default/api/pet.service.ts | 4 ++-- .../petstore/typescript-angular-v2/npm/api/pet.service.ts | 4 ++-- .../typescript-angular-v2/with-interfaces/api/pet.service.ts | 4 ++-- .../petstore/typescript-angular-v4.3/npm/api/pet.service.ts | 4 ++-- .../petstore/typescript-angular-v4/npm/api/pet.service.ts | 4 ++-- .../builds/default/api/pet.service.ts | 4 ++-- .../builds/with-npm/api/pet.service.ts | 4 ++-- .../builds/default/api/pet.service.ts | 4 ++-- .../builds/with-npm/api/pet.service.ts | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 23b832cfabff..55a115fff307 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -257,7 +257,7 @@ export class {{classname}} { {{#hasFormParams}} const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; {{#formParams}} diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 71926b6af584..6692083bc3ca 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -540,7 +540,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -613,7 +613,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 71926b6af584..6692083bc3ca 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -540,7 +540,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -613,7 +613,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 3a8f92b97137..ce0fff0717f7 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -541,7 +541,7 @@ export class PetService implements PetServiceInterface { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -614,7 +614,7 @@ export class PetService implements PetServiceInterface { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 39132299161b..a982e419569d 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -415,7 +415,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -485,7 +485,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 71926b6af584..6692083bc3ca 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -540,7 +540,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -613,7 +613,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 5d494f52dea4..82575f519aaa 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -415,7 +415,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -485,7 +485,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 5d494f52dea4..82575f519aaa 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -415,7 +415,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -485,7 +485,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 8af05a1c5212..e002c9a15cd8 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -417,7 +417,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -487,7 +487,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 8af05a1c5212..e002c9a15cd8 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -417,7 +417,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -487,7 +487,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): any; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data"