typescript-fetch: Fix compatibility with noImplicitAny TS rule (#4711)

* Fix compatibility with noImplicitAny TS rule (required with CRNA app)

*  new file added with bin/typescript-fetch-petstore.sh

* missing files with bin/typescript-fetch-petstore-all.sh

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* Update modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* changed files after bin/typescript-fetch-petstore-all.sh

* re-generate samples, fix windows typescript fetch script
This commit is contained in:
Sami Jaber 2019-12-06 14:17:46 +01:00 committed by Esteban Gehring
parent 775cf655f9
commit da44e458e0
9 changed files with 33 additions and 33 deletions

View File

@ -7,6 +7,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces --additional-properties prefixParameterInterfaces=true set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-fetch -c bin\typescript-fetch-petstore-prefix-parameter-interfaces.json -o samples\client\petstore\typescript-fetch\builds\prefix-parameter-interfaces
java %JAVA_OPTS% -jar %executable% %ags% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -275,7 +275,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -283,7 +283,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -291,7 +291,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -299,7 +299,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }

View File

@ -286,7 +286,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -294,7 +294,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -302,7 +302,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -310,7 +310,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }

View File

@ -286,7 +286,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -294,7 +294,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -302,7 +302,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -310,7 +310,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }

View File

@ -286,7 +286,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -294,7 +294,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -302,7 +302,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -310,7 +310,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }

View File

@ -286,7 +286,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -294,7 +294,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -302,7 +302,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -310,7 +310,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }

View File

@ -286,7 +286,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -294,7 +294,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -302,7 +302,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -310,7 +310,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }

View File

@ -286,7 +286,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -294,7 +294,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -302,7 +302,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -310,7 +310,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }

View File

@ -286,7 +286,7 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> { export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {} constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
async value() { async value(): Promise<T> {
return this.transformer(await this.raw.json()); return this.transformer(await this.raw.json());
} }
} }
@ -294,7 +294,7 @@ export class JSONApiResponse<T> {
export class VoidApiResponse { export class VoidApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<void> {
return undefined; return undefined;
} }
} }
@ -302,7 +302,7 @@ export class VoidApiResponse {
export class BlobApiResponse { export class BlobApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<Blob> {
return await this.raw.blob(); return await this.raw.blob();
}; };
} }
@ -310,7 +310,7 @@ export class BlobApiResponse {
export class TextApiResponse { export class TextApiResponse {
constructor(public raw: Response) {} constructor(public raw: Response) {}
async value() { async value(): Promise<string> {
return await this.raw.text(); return await this.raw.text();
}; };
} }